Question:I am trying to create a null bootstrap in R. The dataset has four species and associated sample values. I want to calculate the
meanand a special
poissonfunction, sampling 5 values at a time from the distribution associated with each species. Here is my attempt at the code. I sampled 5 and tried to use summarise to calculate the mean and poisson function from those five values. I get an error that says
! New rows can't add columns.Any suggestions on how to correct this to get the desrired output (attached).
Answer:The issue with error is based on the difference in column name in ‘output’ i.e.
poisson.setand in the for loop
possion.set. By correcting either one of them, it works (In addition,
spwas not created in the
forloop as well, i.e.
group_bythe ‘sp’ column and use
replicate/rerunfor multiple iterations
If you have better answer, please add a comment about this, thank you!