#' Read yield data from CSV file exported from SMS Advanced software
#'
#' Read yield data from CSV file exported from SMS Advanced software
#'
#' @param filename Name of input file.
#'
#' @author Fiona Evans
#'
#' @return Returns a dataframe.
#' @export
SMSyieldCSV <- function(filename, low=0.01, high=0.99) {
dat <- read.csv(filename)
dat <- subset(dat, select=c("Longitude", "Latitude", "Product", "Date", "Elevation.m.", "Yld.Mass.Dry..tonne.ha."))
dat$Year <- as.numeric(format(as.Date(as.character(dat$Date), "%d/%m/%Y"), "%Y"))
dat$Yield.tha <- qfilter(dat$Yld.Mass.Dry..tonne.ha., low=low, high=high)
dat
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.