Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Update: I also added the confidence interval for the Shannon index: ``` #! Hutcheson's t-test for Shannon diversity equality # thanks to Karl Schilling and Rui Barradas hutcheson = function(A, B){ # compute Shannon index, variance and sum of elements A_index <- Shannon(A) B_index <- Shannon(B

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Hello, thank you for the code. To explain better, when I used vegan, I did not count the species directly but simply prepared a dataframe where, for each species, I counted the number of samples bearing such species: ``` > str(new_df) 'data.frame': 3 obs. of 46 variables: $ NC_001416 Enterobacte

Re: [R] facet_wrap(nrow) ignored

2020-09-10 Thread Ivan Calandra
Thank you Ulrik for the suggestions. I was thinking of a similar approach using a nested patchwork (which would be easier for me). It's just a shame that it is not possible to force a number of rows. It's good that ggplot2 tries to do things in the most "appropriate" way, but at some point, when

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Rui Barradas
Hello, Sorry, there's an instruction missing. See inline. Às 11:44 de 10/09/20, Rui Barradas escreveu: If you want a function automating Karl's code, here it is. It returns an object of S3 class "htest", R's standard for hypothesis tests functions. The returned object can then be subset in the

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Rui Barradas
If you want a function automating Karl's code, here it is. It returns an object of S3 class "htest", R's standard for hypothesis tests functions. The returned object can then be subset in the usual ways, ht$statistic, ht$parameter, ht$p.value, etc. library(QSutils) hutcheson.test <- function

Re: [R] facet_wrap(nrow) ignored

2020-09-10 Thread Ulrik Stervbo via R-help
Dear Ivan, I don't think it is possible to force a number of rows - but I'm honestly just guessing. What you can do is to add an empty plot. Here I use cowplot, but gridExtra should also work well. I add an indication of the row number for the plot to the initial data.frame, and loop over

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Update: I can see that you used the function Shannon from the package QSutils. This would supplement the iNext package I used and solve the problem. Thank you. On Thu, Sep 10, 2020 at 10:35 AM Luigi Marongiu wrote: > > Thank you very much for the code, that was very helpful. > I got the article b

Re: [R] Some code to run Hutcheson t-test using R

2020-09-10 Thread Luigi Marongiu
Thank you very much for the code, that was very helpful. I got the article by Hutcheson -- I don't know if I can distribute it , given the possible copyrights, or if I can attach it here -- but it does not report numbers directly: it refers to a previous article counting bird death on a telegraph e