> 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-projec
charmatch("o", strstplit("hello",""))
but it gives 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 con
> 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-pr
?".
How does this work?
Thanks for any hint!
--
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
and provide commented, minimal, self-contained, reproducible code.
x27;3', '2', '2', '3'))
> > lets=="B"
> [1] FALSE TRUE FALSE FALSE TRUE FALSE TRUE
> > sum(lets=="B" & nums=="2")
> [1] 2
Thanks very much, it will save me :^)
As I am a beginner
> Try this;
>
> > f <- c( 'A', 'B', 'A', 'C', 'B', 'D', 'B')
> > n <- c('1', '2', '2', '3', '2', '2', '3')
> > table(paste(f,
I tried doing it with loops (looping on one factor for 'B', looking for
the corresponding value in the second factor, and incrementing a counter
when the corresponding value is '2'), but I didn't succeed, and I know it's
not the R-way.
Any hint or direction?
Thanks.
--
7 matches
Mail list logo