Re: [R] using nested ifelse when i want to process values from more than 3 columns of data frame

2016-10-24 Thread Mark Sharp
Indira, I think you are wanting to define a new column (target) with "all_true", "all_false", or "other" based on columns H1, H2, H3, and H8 all being equal to 1, all being equal to 0, and other wise respectively. If so, then you do not need apply() or ifelse(). I believe this does what you

Re: [R] using nested ifelse when i want to process values from more than 3 columns of data frame

2016-10-24 Thread David L Carlson
t of Anthropology Texas A University -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Indhira, Anusha Sent: Monday, October 24, 2016 7:06 AM To: r-help@r-project.org Subject: Re: [R] using nested ifelse when i want to process values from more than 3 columns

Re: [R] using nested ifelse when i want to process values from more than 3 columns of data frame

2016-10-24 Thread Indhira, Anusha
Got past the syntax error,now I got new error below Error in match.fun(FUN) : c("'ifelse((kmeans.data$HBV51OpenDmd & kmeans.data$HBV52OpenDmd & ' is not a function, character or symbol", "' kmeans.data$HBV53OpenDmd & kmeans.data$HBV8OpenDmd) == 1, ' is not a function, character or symbol", "'

[R] using nested ifelse when i want to process values from more than 3 columns of data frame

2016-10-24 Thread Indhira, Anusha
Hi, I would like to process each row of data frame having 8 columns of which I am interested in 4 columns for my analysis.I tried using apply function but I get syntax error,although I checked for missing syntaxes ,couldn't figure out the mistake.Can you also suggest me more efficient way to