I have this. I have modified your input structure to be a matrix. I
think it is generally recommended to use matrices over data.frames
when your data allows it, i.e., when you only have one type of data,
here character(). Matrices are easier to work with.
x <- matrix( c('BMW', '', '', 'Mercedes
saschaview wrote on 12/01/2011 12:30:18 PM:
> Hello
>
> I have a data frame, x, holding 5 persons answering the question which
> cars they have used:
>
> # the data frame
> x <- as.data.frame(
>matrix(
> c('BMW', '', '',
>'Mercedes', 'VW', '',
>'Skoda', 'VW', 'BMW',
>
Hello
Hello
I have a data frame, x, holding 5 persons answering the question which
cars they have used:
# the data frame
x <- as.data.frame(
matrix(
c('BMW', '', '',
'Mercedes', 'VW', '',
'Skoda', 'VW', 'BMW',
'', '', '',
'VW', 'Skoda', ''
),
ncol=3,
3 matches
Mail list logo