uploadStock | R Documentation |
Get summary results of historical stock size, recruitment, and fishing pressure.
uploadStock(file, upload = FALSE, verbose = FALSE)
file |
the xml file to check and upload |
upload |
should the file be uploaded to the database? Default is FALSE. |
verbose |
if TRUE more verbose messages are reported |
The database key of the new / updated stock, or 0 if there was an error.
Colin Millar.
stockInfo
creates a list of stock information.
stockFishdata
creates a data.frame of fish stock summary data.
## Not run:
info <-
stockInfo(
StockCode = "whb-comb",
AssessmentYear = 1996,
ContactPerson = "its_me@somewhere.gov",
StockCategory = 3,
Purpose = "InitAdvice",
ModelType = "A",
ModelName = "XSA"
)
fishdata <- stockFishdata(1950:1996)
# simulate some landings for something a bit intesting
set.seed(1232)
fishdata$Landings <- 10^6 * exp(cumsum(cumsum(rnorm(nrow(fishdata), 0, 0.1))))
# You should write out to an xml file and then upload that file
tempfile <- tempfile(fileext = ".xml")
writeSAGxml(info, fishdata, file = tempfile)
# you can check the file is formatted correctly
uploadStock(tempfile, upload = FALSE)
# and if all checks pass, the file can be uploaded
uploadStock(tempfile, upload = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.