I have a file that reads like this: Species,Year,Julian_day Alnus_glutinosa, 1873, 123 Sorbus_aucuparia, 1873, 122 ....(more species...) Alnus_glutinosa, 1874, 134 Sorbus_aucuparia, 1874, 143 ....(more species and years) Is there a way to plot this as julian day over years so that each species get a different color? Also is it possible to convert this data into the format: Alnus_glutinosa, Sorbus_aucuparia,....(more species) 123 122 134 143 ...(more years) Then I could attatch a time series to the data. -- View this message in context: http://r.789695.n4.nabble.com/shuffling-of-data-tp2542615p2542615.html Sent from the R help mailing list archive at Nabble.com.
Something like this? library(ggplot2) qplot(Year, Julian_day, data=a, colour=Species) On Thu, Sep 16, 2010 at 12:14 PM, fugelpitch <jonas at runtimerecords.net> wrote:> > I have a file that reads like this: > > Species,Year,Julian_day > Alnus_glutinosa, 1873, 123 > Sorbus_aucuparia, 1873, 122 > ....(more species...) > Alnus_glutinosa, 1874, 134 > Sorbus_aucuparia, 1874, 143 > ....(more species and years) > > Is there a way to plot this as julian day over years so that each species > get a different color? > Also is it possible to convert this data into the format: > Alnus_glutinosa, Sorbus_aucuparia,....(more species) > 123 ? ? ? ? ? ? ? ? 122 > 134 ? ? ? ? ? ? ? ? 143 > ...(more years) > > Then I could attatch a time series to the data. > -- > View this message in context: http://r.789695.n4.nabble.com/shuffling-of-data-tp2542615p2542615.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Stephen Sefick ____________________________________ | Auburn University? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? | | Department of Biological Sciences? ? ? ? ?? | | 331 Funchess Hall? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | | Auburn, Alabama? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? | | 36849? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | |___________________________________| | sas0025 at auburn.edu? ? ? ? ? ? ? ? ? ? ? ? ? ?? | | http://www.auburn.edu/~sas0025? ? ? ? ? ?? | |___________________________________| Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods.? We are mammals, and have not exhausted the annoying little problems of being mammals. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -Robert Gentleman
On Sep 16, 2010, at 1:14 PM, fugelpitch wrote:> > I have a file that reads like this:How much R do you know? Are you still at the stage where you need basic help reading a file into a session?> > Species,Year,Julian_day > Alnus_glutinosa, 1873, 123 > Sorbus_aucuparia, 1873, 122 > ....(more species...) > Alnus_glutinosa, 1874, 134 > Sorbus_aucuparia, 1874, 143 > ....(more species and years) > > Is there a way to plot this as julian day over years so that each > species > get a different color?If (as is quite likely) that species variable is (or will be) actually a factor, you could use as.numeric(Species) as a vector for the color argument. with(dfname, plot(Julian_day, Year, col=as.numeric(Species)))> Also is it possible to convert this data into the format: > Alnus_glutinosa, Sorbus_aucuparia,....(more species) > 123 122 > 134 143 > ...(more years)?reshape package::reshape2 (and possibly other tabulating, time-series, and recoding options, depending on all those devilish details you have unfortunately omitted.)> > Then I could attatch a time series to the data. > -- > View this message in context: http://r.789695.n4.nabble.com/shuffling-of-data-tp2542615p2542615.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.David Winsemius, MD West Hartford, CT