Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Fixing cran notes errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emhart committed Apr 17, 2014
1 parent 526f3a3 commit edae801
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 22 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions R/get_ensemble_precip.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion R/get_ensemble_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions R/get_ensemble_temp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions R/get_historical_precip.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions R/get_historical_temp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions R/get_model_temp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions man/get_ensemble_precip.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

3 changes: 2 additions & 1 deletion man/get_ensemble_stats.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

6 changes: 4 additions & 2 deletions man/get_ensemble_temp.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

6 changes: 4 additions & 2 deletions man/get_historical_precip.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}
}
Expand Down
6 changes: 4 additions & 2 deletions man/get_model_temp.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

0 comments on commit edae801

Please sign in to comment.