Re: [R] transform data.frame holding answers --> data.frame holding logicals

2011-12-01 Thread Florent D.
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

Re: [R] transform data.frame holding answers --> data.frame holding logicals

2011-12-01 Thread Jean V Adams
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', >

[R] transform data.frame holding answers --> data.frame holding logicals

2011-12-01 Thread saschaview
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,