A set of functions to call with R to the OpenSilex web service in OpenSILEX. You can retrieve data and metadata from experiments. User can access if he/she has an account on an instance of the OpenSilex Information System.
To initialize a client request:
- connectToOpenSILEX()
- getExperiments()
- getVariablesByExperiment()
Functions in progress...
- getExperimentDesign()
- getData()
To install the opensilexClientR package, the easiest is to install it directly from Github. Open an R session and run the following commands:
library(remotes)
install_github("OpenSILEX/opensilexClientR", build_vignettes=TRUE, ref="1.0.0")
You can also download a tar.gz archive of "1.0.0" version and install it with install_packages().
Do not forget to remove old versions of the dependencies to allow the installation of the library.
This package use Semantic Versioning Specification for versioning tags.
Once the package is installed on your computer, it can be loaded into a R session:
library(opensilexClientR)
help(package="opensilexClientR")
library(opensilexClientR)
This package performs request to openSILEX Web Service. We can distinguish two kinds of request:
- GET requests that retrieve data from the Web Service.
- POST requests that send data to the Web Service.
They are named accordingly to the HTTP method GET and POST associated to it.
Because these functions rely on HTTP method, the first answer of the functions is the status of the request:
- 200 and family: means the request has succeeded
- 300 and family: means the request was reoriented elsewhere
- 400 and family: means the request failed from your side (your fault)
- 500 and family: means that the request failed from the server (not your fault)
What is distinct between the functions is the value taken in the $data list.
Because this package aims at providing the most generic functions, the format has to be compatible with a lot of data structures. For example, list containing another list (a properties argument typically). That is to say, data.frames are not always compliant enough.
OpenSILEX relies on URI (Uniform Resource Identifier) to identify resources. As an identifier, this is an un-ambiguous way to identify objects.
Ask permission to request to the Web Service:
# If you want to access to a private web service, you have to insert the address of the WS and the port
opensilexClientR::connectToOpenSILEX(identifier="[email protected]",
password="guest",
url = "http://www.opensilex.org/rest")
This token is handled automatically for you, but you can access it using the following command :
getUserInformations()
experiments <- getExperiments()
experiments$data
experimentVariables <- getVariablesByExperiment(uri="http://www.opensilex.org/demo/2018/o18000076")
experimentVariables$data
------------ Developper part ------------
sessionInfo()
- R Development Core Team (2018). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL http://www.R-project.org.
You should cite the opensilexClientR package:
citation("opensilexClientR")
See also citation() for citing R itself.