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

Commit

Permalink
Fixed name space calls to pass cran check.
Browse files Browse the repository at this point in the history
  • Loading branch information
emhart committed Apr 10, 2014
1 parent 34cee82 commit 5d0b367
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion R/create_map_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ create_map_df <- function(locator) {
### All error handling is done in the download_kml()
locator <- as.character(locator)
locator <- toupper(locator)
rWBclimate:::download_kml(locator)
download_kml(locator)


my_path <- path.expand(getOption("kmlpath"))
Expand Down
2 changes: 1 addition & 1 deletion R/date_correct.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'@examples \dontrun{
#'date_correct(1921,1957)
#'}
#'@export


date_correct <- function(start, end){
#basic error handling of user input
Expand Down
2 changes: 1 addition & 1 deletion R/get_climate_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ get_climate_data <- function(locator,geo_type,type, cvar, start, end){

### Error handling
if(geo_type == "country"){
rWBclimate:::check_ISO_code(locator)
check_ISO_code(locator)
}

if(geo_type == "basin"){
Expand Down
2 changes: 1 addition & 1 deletion R/get_data_recursive.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


get_data_recursive <- function(locator,geo_type,type, cvar, start, end){
dates <- rWBclimate:::date_correct(start,end)
dates <- date_correct(start,end)
data_out <- list()
counter <- 1
for(i in 1:length(locator)){
Expand Down
2 changes: 1 addition & 1 deletion R/get_ensemble_climate_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ get_ensemble_climate_data <- function(locator,geo_type,type, cvar, start, end){

### Error handling
if(geo_type == "country"){
rWBclimate:::check_ISO_code(locator)
check_ISO_code(locator)
}

if(geo_type == "basin"){
Expand Down
4 changes: 2 additions & 2 deletions R/get_ensemble_data_recursive.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@


get_ensemble_data_recursive <- function(locator,geo_type,type, cvar, start, end){
dates <- rWBclimate:::date_correct(start,end)
dates <- date_correct(start,end)
data_out <- list()
counter <- 1
for(i in 1:length(locator)){
for(j in 1:length(dates[,1])){
data_out[[counter]] <- rWBclimate:::get_ensemble_climate_data(locator[i],geo_type,type,cvar,dates[j,1],dates[j,2])
data_out[[counter]] <- get_ensemble_climate_data(locator[i],geo_type,type,cvar,dates[j,1],dates[j,2])
counter <- counter + 1
}
}
Expand Down
4 changes: 2 additions & 2 deletions R/get_ensemble_precip.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ get_ensemble_precip <- function(locator,type, start, end){

#Convert numeric basin numbers to strings if they were entered incorrectly
locator <- as.character(locator)
geo_ref <- rWBclimate:::check_locator(locator)
geo_ref <- check_locator(locator)


output <- rWBclimate:::get_ensemble_data_recursive(locator,geo_ref,type, "pr", start, end)
output <- get_ensemble_data_recursive(locator,geo_ref,type, "pr", start, end)
return(output)
}
4 changes: 2 additions & 2 deletions R/get_ensemble_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ get_ensemble_stats <- function(locator, type, stat){
locator <- as.character(locator)

## Error handling for location input
geo_ref <- rWBclimate:::check_locator(locator)
geo_ref <- check_locator(locator)


### Set dates to retrieve both future scenarios.
Expand All @@ -61,7 +61,7 @@ get_ensemble_stats <- function(locator, type, stat){
counter <- 1
for(i in 1:length(locator)){
for(j in 1:length(dates[,1])){
data_out[[counter]] <- rWBclimate:::get_ensemble_climate_data(locator[i],geo_ref,type,stat,dates[j,1],dates[j,2])
data_out[[counter]] <- get_ensemble_climate_data(locator[i],geo_ref,type,stat,dates[j,1],dates[j,2])
counter <- counter + 1
}
}
Expand Down
4 changes: 2 additions & 2 deletions R/get_ensemble_temp.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ get_ensemble_temp <- function(locator,type, start, end){
}
#Convert numeric basin numbers to strings if they were entered incorrectly
locator <- as.character(locator)
geo_ref <- rWBclimate:::check_locator(locator)
geo_ref <- check_locator(locator)

output <- rWBclimate:::get_ensemble_data_recursive(locator,geo_ref,type, "tas", start, end)
output <- get_ensemble_data_recursive(locator,geo_ref,type, "tas", start, end)
return(output)
}

4 changes: 2 additions & 2 deletions R/get_historical_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ if(!time_scale%in%time_vec){
}
#Convert numeric basin numbers to strings if they were entered incorrectly
locator <- as.character(locator)
geo_type <- rWBclimate:::check_locator(locator)
geo_type <- check_locator(locator)

### Error handling
if(geo_type == "country"){
rWBclimate:::check_ISO_code(locator)
check_ISO_code(locator)
}

if(geo_type == "basin"){
Expand Down
2 changes: 1 addition & 1 deletion R/get_historical_data_recursive.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ get_historical_data_recursive <- function(locator,cvar,time_scale){
data_out <- list()
counter <- 1
for(i in 1:length(locator)){
data_out[[i]] <- rWBclimate:::get_historical_data(locator[i],cvar,time_scale)
data_out[[i]] <- get_historical_data(locator[i],cvar,time_scale)
}

dat_out <- ldply(data_out,data.frame)
Expand Down
2 changes: 1 addition & 1 deletion R/get_historical_precip.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@

get_historical_precip <- function(locator,time_scale){
cvar <- "pr"
return(rWBclimate:::get_historical_data_recursive(locator,cvar,time_scale))
return(get_historical_data_recursive(locator,cvar,time_scale))
}
2 changes: 1 addition & 1 deletion R/get_historical_temp.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@

get_historical_temp <- function(locator,time_scale){
cvar <- "tas"
return(rWBclimate:::get_historical_data_recursive(locator,cvar,time_scale))
return(get_historical_data_recursive(locator,cvar,time_scale))
}
4 changes: 2 additions & 2 deletions R/get_model_precip.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ get_model_precip <- function(locator,type, start, end){
}
#Convert numeric basin numbers to strings if they were entered incorrectly
locator <- as.character(locator)
geo_ref <- rWBclimate:::check_locator(locator)
geo_ref <- check_locator(locator)

output <- rWBclimate:::get_data_recursive(locator,geo_ref,type, "pr", start, end)
output <- get_data_recursive(locator,geo_ref,type, "pr", start, end)
return(output)
}

4 changes: 2 additions & 2 deletions R/get_model_temp.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ get_model_temp <- function(locator,type, start, end){
}
#Convert numeric basin numbers to strings if they were entered incorrectly
locator <- as.character(locator)
geo_ref <- rWBclimate:::check_locator(locator)
geo_ref <- check_locator(locator)

output <- rWBclimate:::get_data_recursive(locator,geo_ref,type, "tas", start, end)
output <- get_data_recursive(locator,geo_ref,type, "tas", start, end)
return(output)
}
5 changes: 5 additions & 0 deletions R/rWBclimate-package.r
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ NULL
#' @keywords datasets
NULL

#' Basin codes for Africa, used in downloading maps
#' @name Africa_basin
#' @docType data
#' @keywords datasets
NULL

0 comments on commit 5d0b367

Please sign in to comment.