> -----Original Message-----
> I am just trying to split a dataframe of 750 observations of
> 29 variables by "Site", which is a vector in the dataframe
> with five text names (ex. PtaCaracol).
A couple of methods.
i) First, look up ?split, which chops your data frame into a list of five data
frames. Then use lapply on the list to get a list of summaries, or sapply to
get something that will (if the results of your summary are a simple number or
vector) look like an array.
ii) look up ?by, which will do something like lapply (and returns a list with
extra features) and will print a tidier result.
> I tried "subset" ....
> # Divide dataframe by Site names
> Site1 <- subset(Cover, Site = "PtaCaracol")
Check your syntax again; that should have been
Site1 <- subset(Cover, Site == "PtaCaracol")
'=' is a pairwise link or an assignment operator, not the equality test that
subset would be looking for.
Steve E
*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}
______________________________________________
[email protected] 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.