[R] Matching a character in a string

2010-01-25 Thread Fabrice DELENTE
NA (why??) Thinking it may be a type problem, I tried charmatch(o,as.character(strsplit(hello,))) but it gives NA too (why???) So how can I know if a given string contains a given char? Thanks! -- Fabrice DELENTE __ R-help@r-project.org mailing

Re: [R] Matching a character in a string

2010-01-25 Thread Fabrice DELENTE
grep(o, hello) Thanks, I hadn't noticed R has grep included! -- Fabrice DELENTE __ 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

[R] R and Limesurvey

2010-01-23 Thread Fabrice DELENTE
)]=Quel âge avez-vous ? that are the clear text of my question. I'd like to be able to reference these values to display them. I tried print(attributes(data)$variable.labels[V5] but it gives NA whereas I'd like to get Quel âge avez-vous ?. How does this work? Thanks for any hint! -- Fabrice

Re: [R] R and Limesurvey

2010-01-23 Thread Fabrice DELENTE
Hmm, does it help if you first set names(attributes(data)$variable.labels) - names(data) Yes, it does, many thanks! I'll take some time later to work out what all these commands mean :^) -- Fabrice DELENTE __ R-help@r-project.org mailing list

[R] Counting two factors at the same time

2010-01-22 Thread Fabrice DELENTE
didn't succeed, and I know it's not the R-way. Any hint or direction? Thanks. -- Fabrice DELENTE __ 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

Re: [R] Counting two factors at the same time

2010-01-22 Thread Fabrice DELENTE
Try this; f - c( 'A', 'B', 'A', 'C', 'B', 'D', 'B') n - c('1', '2', '2', '3', '2', '2', '3') table(paste(f, n)) Thanks for the incredibly fast answer! I'll give this a shot! -- Fabrice DELENTE __ R-help@r-project.org mailing list https

Re: [R] Counting two factors at the same time

2010-01-22 Thread Fabrice DELENTE
:^) As I am a beginner in R, I have a little trouble understanding factors. Can they be used interchangeably with lists, or are they a different data-type? Can I do on factors everything that I can do on lists? Thanks again! -- Fabrice DELENTE __ R-help