Using CLIVARtools
Brett Longworth
2023-01-04
clivartools.RmdThis vignette serves as a brief introduction to the clivartools package.
Installing
The package should be installed from github. You’ll need the
devtools package installed.
devtools::install_github("blongworth/amstools")To interact with the NOSAMS DB, you’ll need the odbc package installed and a working connection to the NOSAMS database via ODBC. An ODBC connection string should be stored in an environment variable called CONSTRING. The package has been tested with the Microsoft MSSQL driver on Windows and Mac OS X, and with the unixODBC and FreeTDS drivers on Linux.
If a Data Source Name (DSN) is set up within your odbc system, a CONSTRING variable in the following format will work:
"DSN=database;UID=username;PWD=password"
This can be done from R with the Sys.setenv command, but
this may or may not be persistent depending on your environment.
What cruises and stations are available?
Use getCruises and getStations to find what data to work with.
cruises <- getCruises()
cruises[1:5]
stations <- getStations(cruises[5])
stations[1:5]Get data from a profile
Use getProfile to get data for a profile. If
station or cruise are vectors,
getProfile will get data from all cruises/stations
requested. If station is not given, all profiles from a
cruise or cruises are returned.
data <- getProfile("A16S", 51)
head(data)Plot a profile
plotProfile(data)