#' nr_feedeff
#'
#' @param fulldata data to perform actions on
#' @param dims the dimensions
#'
#' @author Jan-Philipp Dietrich
nr_feedeff<-function(fulldata,dims=c(1,3.1)) {
feed_2010<-readGDX(fulldata,"im_feed_bask", format="first_found")*setYears(livestock_production(fulldata)[,"y2010",],NULL)
feed_2010<-feed_2010*readGDX(fulldata,"fm_GE_content", format="first_found")
feed_2010<-dimSums(feed_2010,dim=c(dims,3.2))
prod_2010<-setYears(livestock_production(fulldata)[,"y2010",],NULL)
prod_2010<-prod_2010 * readGDX(fulldata,"fm_GE_content", format="first_found")[,,getNames(prod_2010)]
if(is.null(dims)){
feed_eff<- prod_2010/feed_2010
}else{
feed_eff<- dimSums(prod_2010,dims=dims)/dimSums(feed_2010,dims=dims)
}
return(feed_eff)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.