A package to exchange data and metadata in RStudio and BEXIS2 instances.
- R (v<4.3) (e.g. https://cran.r-project.org/bin/windows/base/ for Windows, otherwise start here)
- RStudio (https://www.rstudio.com/products/rstudio/download/#download)
- Rtools (e.g. https://cran.r-project.org/bin/windows/Rtools/ for Windows, , otherwise start here)
Because the rBExIS package is not available through the RStudio package manager, you need to install it from GitHub. But therefore, you need to install and load devtools first.
#install devtools and add to libary
install.packages("devtools")
library(devtools)
After that, you should be able to load rBExIS within RStudio. And please do not forget to load it as well.
install_github("BEXIS2/rBExIS", subdir = "rBExIS")
library(rBExIS)
After installing the package, there are several commands in addition that you might want to execute. With the following one, you are able to (re-)load all functions from rBExIS.
load_all("rBExIS")
Furthermore, the next one is used to check the consistency of the package.
check("rBExIS")
Before you are actually able to use the package, you need add proper values to the configuration (options). To get a general overview of the options, please use the following command.
bexis.options()
You need to set at least the "base_url" which is the domain/url of that BEXIS2 instance you would like to work with. The example would connect rBExIS to the BEXIS2 instance that is running at "https://demo.bexis2.uni-jena.de/".
bexis.options("base_url" = "https://demo.bexis2.uni-jena.de/")
Within BEXIS2, the functions are either publically available (i.e. no authentication/authorization is needed to execute the function). On the other side, other functions may need authentication to verify the user of that function. For this reason, you have two different opportunities within rBExIS. Either go with the token from your account (Bearer), or use the username and password instead (Basic). The first example uses basic authentication with administrator (username) and administrator (password). Please be aware of the ":" (colon) in between.
bexis.options("authorization_basic" = "administrator:administrator")
The second example is equivalent in the sense of the user and rights. But instead of basic authentication, it uses the bearer token for authentication.
bexis.options("authorization_bearer" = "KJkSKJxEoiXwk9ipAvKkNEJ9isGGi64drtQDRf9KKCDRKSE5JYvz5j8Yx5Unvto5")
So, in general there is no difference in which method you could/should use. If you know your token, you might go with it. But instead of yourself into the system and retrieve the token, you can also use your username and password directly.
That section summarizes the set of functions that are available within rBExIS.
bexis_dataset_ids <- rBExIS::bexis.GetDatasetIds()
That function uses the parameter id to identify the specific dataset you would like to get the data from.
bexis_data <- rBExIS::bexis.GetDatasetById(id)
bexis_metadata_list <- rBExIS::bexis.GetMetadata()
That function uses the parameter id to identify the specific dataset you would like to get the metadata from.
bexis_metadata <- rBExIS::bexis.GetMetadataById(id)
bexis_structures <- rBExIS::bexis.GetDataStructures()
That function uses the parameter id to identify the specific data structure you would like to get the information/details from.
bexis_structures <- rBExIS::bexis.GetDataStructureBy()
- Fork
- Implement/Fix
- Send pull request
- Wait and pray!