The R package specchioR aims to provide simple wrappers to allow interaction with the spectral information system SPECCHIO Java client. This client provides many functions and allows storage and query of a large database of ground-based spectrometry. Two main options for databases exist; using the global database, kindly hosted by the University of Zurich or hosting your own database (with setup facilitated using a virtualisation system).

System requirements

The package has been developed in UNIX (Ubuntu 16.04 LTS), specifics for other operating systems will be updated as they are tested.

UNIX

Setup rJava for interaction with the SPECCHIO client

Once all of the requirements are met specchioR needs to know the path to the SPECCHIO directory, if you followed the default option this should be $HOME/SPECCHIO. We can permanently store this (in extdata/specchioR_config.yaml) as:

require(specchioR)
setSpecchioPath("~/SPECCHIO")
getSpecchioPath()

We also need to define the server parameters for the SPECCHIO client to connect, here is an example using the (test) global database hosted by Univ. Zurich, the function apends an entry to the db_config.txt file in the SPECCHIO directory, registry of your user_name and password is probably easiset done for the first time directly using the Java client.

We can open the client from R using launchGUI(). Navigating to 'Database/Create a new user account' opens a dialog that can be used make your user account. Once this is done we can permantly store the connection details as:

addServerToConfig(protocol="https",
                  server="v473.vanager.de",
                  port="443",
                  path="/specchio_service",
                  user_name="your_user_name",
                  password="your_password",
                  data_source="jdbc/specchio_test",
                  speccio.path=getSpecchioPath()
                  )

Starting the SPECCHIO client

Once these setup options are stored, we can now call the client ready for making queries:

# Connect to the client using the first server definition
sp.client <- createClient(server.id = 1, speccio.path=getSpecchioPath())


edwardpmorris/specchioR documentation built on May 15, 2019, 11:03 p.m.