[R] new to R
linda.s
samrobertsmith at gmail.com
Thu Mar 23 23:11:55 CET 2006
On 3/23/06, Francisco J. Zagmutt <gerifalte28 at hotmail.com> wrote:
> Hi Linda
>
> Did you already get a reply to your question? If not, try adding a new line
> at the end of the text (just hit enter after 69,the last number in your data
> and save the file). You also want to use the argument "sep" in read.table
>
> Since you have a comma at the end of each row you can either manually delete
> that and use read.table, or just import it the way it is and then delete the
> last variable ("V4") created because of the extra comma i.e
>
> z<- read.table("q.txt", sep=",")
> z
> V1 V2 V3 V4
> 1 1 2 3 NA
> 2 33 44 88 NA
> 3 23 43 69 NA
>
> #V4 is an artifact from your extra comma at the end of each row
>
> newz<-z[,-4] #Deletes V4
>
> I hope this helps
>
> Francisco
It works!
Thanks,
Linda
More information about the R-help
mailing list