Re: [R] adding zeros to dataframe

2009-05-01 Thread Mark Wilkinson
Hi Cathy, I interpreted your situation a little differently than the other responses. Please ignore this if their suggestions solved your problem. I assumed you have abundance where available, but otherwise it wasn't recorded--not as NA, just unrecorded. You want to fill in the missing "rows" w

Re: [R] adding zeros to dataframe

2009-05-01 Thread Jorge Ivan Velez
Dear Cathy, Try this: # Some data set.seed(123) DF <- data.frame( Plot=sample(10), Location = sample(10), SpeciesName = sample(LETTERS[1:10]), SpeciesNumber = sample(10), abundance = rnorm(10), treatment = sample(letters[1:3],5, replace=TRUE) ) # M

Re: [R] adding zeros to dataframe

2009-05-01 Thread Ted Harding
On 01-May-09 17:20:08, Collins, Cathy wrote: > 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