r - Analysis and summary or ecological samples -


i working on dataset :

dat<-read.table(text = "sample    pho    spec          1    fags     lic1          2    fags     lic1          3    fags     lic2          5    quep     lic2          6    quep     lic1          7    fags     lic1          8    frae     lic3          9    frae     lic4, header=t) 

and known specie (spec) diversity phorophytes (pho) , able ponderate information comparing specdiv pho versus quantity of sample (nuofsa) pho.

example :

pho     specdiv    nuofsa    ratio fags    2          4         0.5 quep    2          2         1 frae    2          2         1 

the aim plot information through "barplot" in order compare species diversity between phorophytes.

many helpful ;)

r.

this base solution (after replacing missing double quote in example code):

temp <- cbind( specdiv= rowsums( with(dat, table( pho, spec))>0 ),  nuofsa=with(dat, table( pho))) final <- cbind( temp, ratio=temp[,1]/temp[,2]) final #--------      specdiv nuofsa ratio fags       2      4   0.5 frae       2      2   1.0 quep       2      2   1.0 

the difficult part figuring our meaning of phrase "specie (spec) diversity phorophytes (pho)". in future ought explain domain specific conventions bit more thoroughly non-ecologists able offer better assistance. notion of collapsing data on counts present or absent seemed result in serious loss of data way of understanding statistical perspective. question whether having "occasional" (in language of "birders") in observation set qualifies increasing "species diversity".

and plotting task awaits better description of <what> plotted against <what>.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -