[R] data management (subsetting and recombining)

From: stephen sefick <ssefick_at_gmail.com>
Date: Tue, 29 Apr 2008 08:37:27 -0400

This is an example of two months of data from a twenty four month data set that I would like to apply this too. These data are subsets of the same stations throught time, but differing ones were included on different sampling dates. I would like to subset these data and then put them together as a big matrix with the by column being RiverMile. What is the easiest way to proceed as this is a process that will be done on 96+ constituents?

feb06 <- structure(list(RiverMile = c(202L, 190L, 185L), X2.1.06 = c(2850000,
NA, NA)), .Names = c("RiverMile", "X2.1.06"), row.names = c(29L, 31L, 32L), class = "data.frame")

may06 <- structure(list(RiverMile = c(202L, 198L, 190L, 185L, 148L), X5.1.06 = c(NA_real_,
NA_real_, NA_real_, NA_real_, NA_real_)), .Names = c("RiverMile",
"X5.1.06"), row.names = c(29L, 30L, 31L, 32L, 34L), class = "data.frame")

merge(feb06, may06, by="RiverMile")

Error in fix.by(by.x, x) :
  'by' must specify column(s) as numbers, names or logical #I have provided the column name. Is it because they are of differing lengths?



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

	[[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 29 Apr 2008 - 12:57:58 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 Tue 29 Apr 2008 - 15:00:34 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