I read in a CSV file with Data <-
read.csv(file="FileName.csv",head=TRUE,sep=",")

the file containts strings in the 2nd and 3rd columns and each has about
1000 rows.  I need to either loop through the strings there looking for
strings that would trigger other logic or remove those rows and put them in
another array and loop through them in the new array.  I can't seem to get
the if statement to work on the Data strings.  it doesn't recognize the
string.  Oh the strings in the CSV file all have "" around them so Data[1,2]
is "ABC" but...

> if(Data[1,2]=="ABC") tester<-"True" else tester<-"False"
> tester
[1] "False"


What am I doing wrong?

-- 
View this message in context: 
http://www.nabble.com/How-do-I-loop-through-strings--tp23175824p23175824.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to