it worked, but it added a "X" value as a first column with the number of the row, I don't know if it will do it everytime I modify the csv.
Mike:
that's weird that it added a column. i can't think why it would do that. anyway, you can use 'subset()' to remove extraneous columns from a data frame:
> attach(ChickWeight)
> head(ChickWeight)
weight Time Chick Diet
1 42 0 1 1
2 51 2 1 1
3 59 4 1 1
4 64 6 1 1
5 76 8 1 1
6 93 10 1 1
> new.data.frame = subset(ChickWeight, select= -Chick)
> head(new.data.frame)
weight Time Diet
1 42 0 1
2 51 2 1
3 59 4 1
4 64 6 1
5 76 8 1
6 93 10 1
Inscription à :
Publier les commentaires (Atom)
1 commentaire:
excellent. i think posting these here is a great idea, and will indeed be helpful to others.
one suggestion i might make is to incorporate a little bit of HTML formatting in your blog posts that will allow the R code and output to retain its spacing (and therefore will be easier to read). i just blogged about this over on my blog, but in essence, all you have to do is place <PRE> ... <\PRE> around the text and it should display properly.
Enregistrer un commentaire