GET.elabftw.byselector: Request Experimental Data From eLabFTW Via API

View source: R/GET_elabftw.R

GET.elabftw.byselectorR Documentation

Request Experimental Data From eLabFTW Via API

Description

This function fetches experimental data from the online labbook eLabFTW as a data frame. The html table that will be returned as data frame must be marked with a html property, like an id or a class. The table will be selected with the help of this css selector.

Usage

GET.elabftw.byselector(
  experiment.id,
  node.selector = "#experimental-data",
  dec = ",",
  header = F,
  api.key = Sys.getenv("READ_ELABFTW_TOKEN"),
  url = Sys.getenv("ELABFTW_API_URL"),
  outputHTTP = F
)

Arguments

experiment.id

The eLabFTW id of the experiment that will be fetched. The id can be found in the url of the experiment.

node.selector

A css selector that uniquely identifies the html table that should be read. This argument will be passed to rvest::html_nodes() unaltered. Therefore it is also possible to use an XPath selector.

dec

The decimal separator used in the table. The default is the German number notation with a comma instead of a period!

header

Is the first line of the table the column names or data? If true, the first row is no data.

api.key

The eLabFT API-key. See the eLabFTW documentation for details. The default settings retrieve this value from the enviourmental variable READ_ELABFTW_TOKEN. This variable can be set in the ~/.Renviron file.

url

The url to the eLabFTW API. See the eLabFTW documentation for details. The default settings retrieve this value from the enviourmental variable ELABFTW_API_URL. This variable can be set in the ~/.Renviron file.

outputHTTP

Boolean value. If FALSE only the selected tables will be returned. If TRUE the selected tables and the original http response received from the API will be returned. The http response contains meta information needed by other parsing functions.

Details

Keep in mind: Tables that have a caption required by GET.elabftw.bycaption() can't be parsed by this function.

Value

A list of data frames with the content of the selected html tables from the eLabFTW online labbook. If outputHTTP is set TRUE the return value is a list containing the list of all dataframes created from the selected html tables and the original http response received from the API.


AlreadyTakenJonas/RHotStuff documentation built on Oct. 28, 2022, 10:15 p.m.