Description Usage Arguments Details Examples
Functions to import data into MareFrame DB
1 2 3 4 5 | mfdb_import_survey(mdb, data_in, ...)
mfdb_import_area(mdb, data_in)
mfdb_import_division(mdb, data_in)
mfdb_import_temperature(mdb, data_in)
mfdb_import_sampling_type(mdb, data_in)
|
mdb |
Database connection created by |
data_in |
A |
... |
Metadata about the survey data, see details. |
For mfdb_import_survey
, the metadata can contain:
A name for this data, e.g. it's filename. Used so you can replace it later without disturbing other data
Optional. An institute name, see mfdb::institute for possible values
Optional. Gear name, see mfdb::gear for possible values
Optional. Vessel name, see mfdb::vessel for possible values
Optional. A sampling_type, see mfdb::sampling_type for possible values
And data_in
should be a data.frame with the following columns:
Required. Year each sample was taken, e.g. c(2000,2001)
Required. Month (1–12) each sample was taken, e.g. c(1,12)
Required. Areacell sample was taken within
Optional, default c(NA)
. Species of sample, see mfdb::species for possible values
Optional, default c(NA)
. Age of sample, or mean age
Optional, default c(NA)
. Sex of sample, see mfdb::sex for possible values
Optional, default c(NA)
. Length of sample / mean length of all samples
Optional, default c(NA)
. Sample variance, if data is already aggregated
Optional, default c(NA)
. Minimum theoretical length, if data is already aggregated
Optional, default c(NA)
. Weight of sample / mean weight of all samples
Optional, default c(NA)
. Sample variance, if data is already aggregated
Optional, default c(1)
. Number of samples this row represents (i.e. if the data is aggregated)
mfdb_import_area
imports areacell information for your case study. The
data_in
should be a data.frame with the following columns:
A numeric ID for this areacell (will be combined with the case study number internally)
The name of the areacell, e.g. '45G01'
The size of the areacell
mfdb_import_division
imports groupings of areacells into divisions. The
data_in
should be a list of areacell vectors, with division names.
For example, list(divA = c('45G01', '45G02', '45G03'))
mfdb_import_temperature
imports temperature time-series data for
areacells. The data_in
should be a data.frame with the following columns:
A numeric ID for this areacell (will be combined with the case study number internally)
Required. Year each sample was taken, e.g. c(2000,2001)
Required. Month (1–12) each sample was taken, e.g. c(1,12)
Required. Areacell sample was taken within
The temperature at given location/time
mfdb_import_sampling_type
imports names of sampling types for this case
study. The data_in
should be a data.frame with the following columns:
A numeric ID for this sampling type
Required. A vector of short names to use in data, e.g. "SEA"
Optional. A vector of descriptive names, e.g. "sea sampling"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
# data/cod-1998.csv contains:-
# year,month,areacell,species,age,sex,length
# 1998,1,35F1,COD,3,M,140
# 1998,1,35F1,COD,3,M,150
# 1998,1,35F1,COD,3,F,150
mfdb_import_survey(mdb,
data_source = 'cod-1998',
case_study = 'Iceland',
institute = 'MRI',
gear = 'GIL',
vessel = '2.RSH',
sampling_type = 'HAR',
read.csv("data/cod-1998.csv"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.