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). I just want to generate summary statistics for my other variables
for each site individually.
I know this should be simple, and I did read up on options, choosing to use
"subset", but I am honestly confounded that this does not result in a new
dataframe split by this factor. I tried "subset" with an argument based on my
various other numeric vectors, and it worked just fine. My very simple code is
below, and thank you for any responses. I apologize for asking such a simple
question, but I wrote this out exactly as found it in an exactly similar
question, which indicated this should work. Now I am confused! Thank you for
any assistance. Ben Neal
# Load data from CSV file
Cover = read.csv ("/Users/benjaminneal/Documents/1110_Panama/Transect series
/1210_BocasTransectSummary.csv",
header=T)
# Divide dataframe by Site names
Site1 <- subset(Cover, Site = "PtaCaracol")
PS The csv loads fine, gives normal summary stats, and does not seem to be the
issue. I thought about just renaming by hand all the sites in the file (i.e.
"PtaCaracol"=1 . . but this seems like a weak solution).
______________________________________________
[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.