This package contains several functions I developed while analysing ecological data. I started in December 2021, and I hope the package grows over time. This R-Package is my first, and it will also be my first open repository on GitHub. If you find issues and bugs, please report them to me. I'll try to fix them as fast as I can. I'd also appreciate it if you had comments on improving the code in general.
I'll try to keep a Version Log below also up-to-date.
To install bcrtools
, you need to install devtools
first:
install.packages("devtools")
You can subsequently install this development version of bcrtools from R:
devtools::install_github("b-c-r/bcrtools")
select_random()
.glmer()
and lmer()
option to select_random()
.create_factors()
I created a stand-alone function to transform all character-string variables in a data frame into factorials. You can also use the function to update the meta-data in all factorial variables of a data frame after subsetting. The functionality of this function has initially been part of the function read_data(), but as a stand-alone function, you can use any "read" function and transform the data afterwards.
read_data()
uses now create_factors()
The title says it all.
select_random()
I build this function to automatically select the random structure for an analysis using lme()
from the nlme
package. The function selects the whole random structure using either AIC or BIC. Especially random intercept and slopes models often crash with an error. I decided to catch this behaviour using try()
and assign Inf
to the AIC and BIC of the crashed analyses to keep the function running. Moreover, the function uses the parallelised foreach()
loop to increase the speed of this time-consuming selection process. I added some very simple if-clauses to exclude the multi-core looping if it is not needed.
read_data()
This function is simply a wrapper around read.csv()
and allows to convert character strings to factors directly after reading the CSV file. And it automatically shows the data structure via str()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.