Re: [R] Probs with paste

From: Charilaos Skiadas <cskiadas_at_gmail.com>
Date: Mon, 09 Jun 2008 14:54:31 -0400

I have to say it is not clear at all what you expected. risk.factors [1] is the character vector "file$A". You ask it to do a paste of that, so of course it will just return itself. Then you do a table, and naturally it tells you that it found "file$A" exactly once.

So what you have forgotten to tell us (apart from what your overall goal with this is, which might be helpful in this case) is what output you expected instead.

Haris Skiadas
Department of Mathematics and Computer Science Hanover College

On Jun 9, 2008, at 10:44 AM, EVANS David-William wrote:

> Hello all,
>
>
>
> After some months doing ok with R, I am embarrassed that I have to
> make
> this my first posting to the help list. I am trying to run the
> following (actually in a loop but shortened for the post):
>
>
>
> risk.factors <- c("file$A", "file$B", "file$C", "file$D", "file$E")
>
> table(paste(risk.factors[1]))
>
>
>
> but run into problems with the table (paste...) line as I get the
> following output:
>
>
>
>> table(paste(risk.factors[1]))
>
>
>
> file$A
>
> 1
>
>
>
> I think it's a problem with paste including " " around the file
> name but
> cannot get around it. Apologies for the simple nature of this
> question
> and thanks to anyone who can take a moment to help.
>
>
>
> David.
>



R-help_at_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. Received on Mon 09 Jun 2008 - 19:13:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 09 Jun 2008 - 20:31:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive