Greetings,
 
I am new to R and am hoping to get some tips from experienced R-programmers.
 
I have a dataset that I've read into R as a dataframe. There are 5 columns: 
Plot location,species name, a species number code (unique to each species 
name), abundance, and treatment. There are 272 plots in each treatment, but 
only the plots in which the species was recorded have an abundance value.  For 
all species in the dataset, I would like to add zeros to the abundance column 
for any plots in which the species was not recorded, so that each species has 
272 rows.  The data are sorted by species and then abundance, so all of the 
zeros can presumably just be tacked on to the last (272-occupied plots) row for 
each species.
 
My programming skills are still somewhat rudimentary (and biased toward 
VBA-style looping...which seems to be leading me astray). Though I have 
searched, I have not yet seen this particular problem addressed in the help 
files.
 
Many thanks for any suggestions,
Cathy
 
<mailto:ccoll...@ku.edu> 
  

______________________________________________
R-help@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.

Reply via email to