From edae80199f365b7b6bac7b7797ece9398327af77 Mon Sep 17 00:00:00 2001 From: emhart Date: Thu, 17 Apr 2014 10:46:07 -0700 Subject: [PATCH] Fixing cran notes errors --- DESCRIPTION | 5 +++-- R/get_ensemble_precip.R | 6 ++++-- R/get_ensemble_stats.R | 3 ++- R/get_ensemble_temp.R | 6 ++++-- R/get_historical_precip.R | 6 ++++-- R/get_historical_temp.R | 6 ++++-- R/get_model_temp.R | 6 ++++-- man/get_ensemble_precip.Rd | 6 ++++-- man/get_ensemble_stats.Rd | 3 ++- man/get_ensemble_temp.Rd | 6 ++++-- man/get_historical_precip.Rd | 6 ++++-- man/get_model_temp.Rd | 6 ++++-- 12 files changed, 43 insertions(+), 22 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7b55185..818db51 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,8 +11,9 @@ Title: rWBclimate Description: A package for accessing World Bank climate data LazyData: True VignetteBuilder: knitr -Suggests: knitr -Depends: +Suggests: + knitr +Imports: ggplot2, httr, plyr, diff --git a/R/get_ensemble_precip.R b/R/get_ensemble_precip.R index 408a628..f93770a 100644 --- a/R/get_ensemble_precip.R +++ b/R/get_ensemble_precip.R @@ -21,13 +21,15 @@ #' precip_dat <- get_ensemble_precip(c("2","231"),"annualavg",1900,3000) #' precip_dat <- subset(precip_dat,precip_dat$scenario!="b1") #' precip_dat$uniqueGroup <- paste(precip_dat$percentile,precip_dat$locator,sep="-") -#' ggplot(precip_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator),linetype=as.factor(percentile)))+geom_path() +#' ggplot(precip_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator), +#' linetype=as.factor(percentile)))+ geom_path() #' #' ### Get data for 2 countries with monthly precipitation values #' precip_dat <- get_ensemble_precip(c("USA","BRA"),"mavg",2020,2030) #' precip_dat <- subset(precip_dat,precip_dat$scenario!="b1") #' precip_dat$uniqueGroup <- paste(precip_dat$percentile,precip_dat$locator,sep="-") -#' ggplot(precip_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup,colour=locator))+geom_path() +#' ggplot(precip_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup, +#' colour=locator))+geom_path() #'} #'@export diff --git a/R/get_ensemble_stats.R b/R/get_ensemble_stats.R index 69aea11..5db5f78 100644 --- a/R/get_ensemble_stats.R +++ b/R/get_ensemble_stats.R @@ -28,7 +28,8 @@ #' # subset to the 50th percentile and just until the year 2100 #' ens_dat <- subset(ens_dat, ens_dat$percentile == 50) #' ens_dat <- subset(ens_dat,ens_dat$toYear == 2100) -#' ggplot(ens_dat,aes(x = as.factor(month), y= monthVals, group=scenario, colour=scenario)) + geom_point() + geom_line() +#' ggplot(ens_dat,aes(x = as.factor(month), y= monthVals, group=scenario, +#' colour=scenario)) + geom_point() + geom_line() #'} #'@export diff --git a/R/get_ensemble_temp.R b/R/get_ensemble_temp.R index de4cb15..c71a17f 100644 --- a/R/get_ensemble_temp.R +++ b/R/get_ensemble_temp.R @@ -22,13 +22,15 @@ #' temp_dat <- get_ensemble_temp(c("2","231"),"annualavg",1900,3000) #' temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") #' temp_dat$uniqueGroup <- paste(temp_dat$percentile,temp_dat$locator,sep="-") -#' ggplot(temp_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator),linetype=as.factor(percentile)))+geom_path() +#' ggplot(temp_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator), +#' linetype=as.factor(percentile)))+geom_path() #' #' ### Get data for 2 countries with monthly precipitation values #' temp_dat <- get_ensemble_temp(c("USA","BRA"),"mavg",2020,2030) #' temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") #' temp_dat$uniqueGroup <- paste(temp_dat$percentile,temp_dat$locator,sep="-") -#' ggplot(temp_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup,colour=locator))+geom_path() +#' ggplot(temp_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup, +#' colour=locator))+geom_path() #'} #'@export diff --git a/R/get_historical_precip.R b/R/get_historical_precip.R index e95aa7f..513ff10 100644 --- a/R/get_historical_precip.R +++ b/R/get_historical_precip.R @@ -12,11 +12,13 @@ #' @examples \dontrun{ #' ## Plot annual historical data for USA, Brazil and Australia #' hist_dat <- get_historical_precip(c("USA","BRA","AUS"),"year") -#' ggplot(hist_dat,aes(x = year,y = data, group = locator,colour = locator)) + geom_point() + geom_path() + ylab("Mean annual precipitaion") +#' ggplot(hist_dat,aes(x = year,y = data, group = locator, +#' colour = locator)) + geom_point() + geom_path() + ylab("Mean annual precipitaion") #' #' ## Plot monthly historical data #' hist_mo_dat <- get_historical_precip(c("USA","AUS","BRA","IDN"),time_scale="month") -#' ggplot(hist_mo_dat,aes(x = month,y = data, group = locator,colour = locator)) + geom_point() + geom_path() + ylab("Mean monthly precipitaion") +#' ggplot(hist_mo_dat,aes(x = month,y = data, group = locator, +#' colour = locator)) + geom_point() + geom_path() + ylab("Mean monthly precipitaion") #' #' } #' @export diff --git a/R/get_historical_temp.R b/R/get_historical_temp.R index 443b47a..6403bb7 100644 --- a/R/get_historical_temp.R +++ b/R/get_historical_temp.R @@ -12,11 +12,13 @@ #' @examples \dontrun{ #' ## Plot annual historical data for USA, Brazil and Australia #' hist_dat <- get_historical_precip(c("USA","BRA","AUS"),"year") -#' ggplot(hist_dat,aes(x = year,y = data, group = locator,colour = locator)) + geom_point() + geom_path() + ylab("Mean annual temperature") +#' ggplot(hist_dat,aes(x = year,y = data, group = locator, +#' colour = locator)) + geom_point() + geom_path() + ylab("Mean annual temperature") #' #' ## Plot monthly historical data #' hist_mo_dat <- get_historical_precip(c("USA","AUS","BRA","IDN"),time_scale="month") -#' ggplot(hist_mo_dat,aes(x = month,y = data, group = locator,colour = locator)) + geom_point() + geom_path() + ylab("Mean monthly temperature") +#' ggplot(hist_mo_dat,aes(x = month,y = data, group = locator, +#' colour = locator)) + geom_point() + geom_path() + ylab("Mean monthly temperature") #' #' } #' @export diff --git a/R/get_model_temp.R b/R/get_model_temp.R index 429f215..2002f66 100644 --- a/R/get_model_temp.R +++ b/R/get_model_temp.R @@ -20,13 +20,15 @@ #' temp_dat <- get_model_temp(c("2","231"),"annualavg",1900,3000) #' temp_dat <- subset(temp_dat,temp_dat$gcm=="ukmo_hadcm3") #' temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") -#' ggplot(temp_dat,aes(x=fromYear,y=data,group=locator,colour=locator))+geom_path() +#' ggplot(temp_dat,aes(x=fromYear,y=data,group=locator, +#' colour=locator))+geom_path() #' #' ### Get data for 4 countries with monthly tempitation values #' temp_dat <- get_model_temp(c("USA","BRA","CAN","YEM"),"mavg",2020,2030) #' temp_dat <- subset(temp_dat,temp_dat$gcm=="ukmo_hadcm3") #' temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") -#' ggplot(temp_dat,aes(x=as.factor(month),y=data,group=locator,colour=locator))+geom_path() +#' ggplot(temp_dat,aes(x=as.factor(month),y=data,group=locator, +#' colour=locator))+geom_path() #'} #'@export diff --git a/man/get_ensemble_precip.Rd b/man/get_ensemble_precip.Rd index 7d1ea98..3368bb7 100644 --- a/man/get_ensemble_precip.Rd +++ b/man/get_ensemble_precip.Rd @@ -45,13 +45,15 @@ full details. precip_dat <- get_ensemble_precip(c("2","231"),"annualavg",1900,3000) precip_dat <- subset(precip_dat,precip_dat$scenario!="b1") precip_dat$uniqueGroup <- paste(precip_dat$percentile,precip_dat$locator,sep="-") -ggplot(precip_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator),linetype=as.factor(percentile)))+geom_path() +ggplot(precip_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator), +linetype=as.factor(percentile)))+ geom_path() ### Get data for 2 countries with monthly precipitation values precip_dat <- get_ensemble_precip(c("USA","BRA"),"mavg",2020,2030) precip_dat <- subset(precip_dat,precip_dat$scenario!="b1") precip_dat$uniqueGroup <- paste(precip_dat$percentile,precip_dat$locator,sep="-") -ggplot(precip_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup,colour=locator))+geom_path() +ggplot(precip_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup, +colour=locator))+geom_path() } } diff --git a/man/get_ensemble_stats.Rd b/man/get_ensemble_stats.Rd index 091a460..3a9074c 100644 --- a/man/get_ensemble_stats.Rd +++ b/man/get_ensemble_stats.Rd @@ -56,7 +56,8 @@ Average daily precipitation \tab mm } # subset to the 50th percentile and just until the year 2100 ens_dat <- subset(ens_dat, ens_dat$percentile == 50) ens_dat <- subset(ens_dat,ens_dat$toYear == 2100) - ggplot(ens_dat,aes(x = as.factor(month), y= monthVals, group=scenario, colour=scenario)) + geom_point() + geom_line() + ggplot(ens_dat,aes(x = as.factor(month), y= monthVals, group=scenario, + colour=scenario)) + geom_point() + geom_line() } } diff --git a/man/get_ensemble_temp.Rd b/man/get_ensemble_temp.Rd index 1ec50ba..b4d1532 100644 --- a/man/get_ensemble_temp.Rd +++ b/man/get_ensemble_temp.Rd @@ -45,13 +45,15 @@ full details. temp_dat <- get_ensemble_temp(c("2","231"),"annualavg",1900,3000) temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") temp_dat$uniqueGroup <- paste(temp_dat$percentile,temp_dat$locator,sep="-") -ggplot(temp_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator),linetype=as.factor(percentile)))+geom_path() +ggplot(temp_dat,aes(x=fromYear,y=annualVal,group=uniqueGroup,colour=as.factor(locator), +linetype=as.factor(percentile)))+geom_path() ### Get data for 2 countries with monthly precipitation values temp_dat <- get_ensemble_temp(c("USA","BRA"),"mavg",2020,2030) temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") temp_dat$uniqueGroup <- paste(temp_dat$percentile,temp_dat$locator,sep="-") -ggplot(temp_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup,colour=locator))+geom_path() +ggplot(temp_dat,aes(x=as.factor(month),y=monthVals,group=uniqueGroup, +colour=locator))+geom_path() } } diff --git a/man/get_historical_precip.Rd b/man/get_historical_precip.Rd index 7c07f48..a1f8fc8 100644 --- a/man/get_historical_precip.Rd +++ b/man/get_historical_precip.Rd @@ -37,11 +37,13 @@ will return decade averages. \dontrun{ ## Plot annual historical data for USA, Brazil and Australia hist_dat <- get_historical_precip(c("USA","BRA","AUS"),"year") -ggplot(hist_dat,aes(x = year,y = data, group = locator,colour = locator)) + geom_point() + geom_path() + ylab("Mean annual precipitaion") +ggplot(hist_dat,aes(x = year,y = data, group = locator, +colour = locator)) + geom_point() + geom_path() + ylab("Mean annual precipitaion") ## Plot monthly historical data hist_mo_dat <- get_historical_precip(c("USA","AUS","BRA","IDN"),time_scale="month") -ggplot(hist_mo_dat,aes(x = month,y = data, group = locator,colour = locator)) + geom_point() + geom_path() + ylab("Mean monthly precipitaion") +ggplot(hist_mo_dat,aes(x = month,y = data, group = locator, +colour = locator)) + geom_point() + geom_path() + ylab("Mean monthly precipitaion") } } diff --git a/man/get_model_temp.Rd b/man/get_model_temp.Rd index 00939cf..c05e4e2 100644 --- a/man/get_model_temp.Rd +++ b/man/get_model_temp.Rd @@ -44,13 +44,15 @@ full details. temp_dat <- get_model_temp(c("2","231"),"annualavg",1900,3000) temp_dat <- subset(temp_dat,temp_dat$gcm=="ukmo_hadcm3") temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") -ggplot(temp_dat,aes(x=fromYear,y=data,group=locator,colour=locator))+geom_path() +ggplot(temp_dat,aes(x=fromYear,y=data,group=locator, +colour=locator))+geom_path() ### Get data for 4 countries with monthly tempitation values temp_dat <- get_model_temp(c("USA","BRA","CAN","YEM"),"mavg",2020,2030) temp_dat <- subset(temp_dat,temp_dat$gcm=="ukmo_hadcm3") temp_dat <- subset(temp_dat,temp_dat$scenario!="b1") -ggplot(temp_dat,aes(x=as.factor(month),y=data,group=locator,colour=locator))+geom_path() +ggplot(temp_dat,aes(x=as.factor(month),y=data,group=locator, +colour=locator))+geom_path() } }