Skip to content

Commit

Permalink
Merge pull request #2 from StatisticalServicesCentre/master
Browse files Browse the repository at this point in the history
merge from main
  • Loading branch information
dannyparsons authored Jul 28, 2016
2 parents f64abfa + 0f6b962 commit 30fdd9b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions R/ClimateMethods/Graphics/cliplot_method.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
#' ClimateObj <- climate( data_tables = list( dataframe=dataframe ), date_formats = list( "%m/%d/%Y" ) )
#' Default dateformats: "%Y/%m/%d"
#' where "data" is a data.frame containing the desired data to be computed.
#' climateObj$cliplot(var_x=year_label, var_y=rain_label).
#' climateObj$cliplot().
#' climateObj$cliplot(var_y = "Total Rain", data_period_label = yearly_label).
#' @return time series plot(s).
#'
#'data_period_label is included in the method to plot the summary_obj (yearly_summaries)
#'variables e.g start of the rain

climate$methods(cliplot = function(data_list=list(),var_x,var_y,linetype=1,color=c("blue"),by_factor=FALSE,data_period_label=yearly_label,
climate$methods(cliplot = function(data_list=list(),var_x = year_label, var_y = rain_label, linetype=1,color=c("blue"),by_factor=FALSE,data_period_label = daily_label,
x_axis_lab,y_axis_lab, main_title,size=0,xlim = NULL, ylim = NULL, wise = NULL,
stat = "identity", position = "identity", show.legend = NA, inherit.aes = TRUE,factor_var,
station_name=TRUE,variable.name = "variable", na.rm = FALSE){
Expand Down Expand Up @@ -77,13 +78,13 @@ climate$methods(cliplot = function(data_list=list(),var_x,var_y,linetype=1,color
scale_colour_manual(values=color)+ coord_cartesian(xlim = xlim, ylim = ylim, wise = wise)
)
}else{
for( curr_data in curr_data_list ) {
for( curr_data in curr_data_list ) {
curr_data=subset(curr_data,select=c(var_x_name, var_y_name))
curr_data <- melt(curr_data, id.vars=var_x_name, variable.name = variable.name, na.rm = na.rm)
print(ggplot(data= curr_data,aes_string(x=var_x_name, y="value", group=variable.name,colour=variable.name))+
geom_line(linetype=linetype,stat = stat, position = position, show.legend = show.legend,
inherit.aes = inherit.aes, size=size) + xlabel+ylabel+main_title2 +
scale_colour_manual(values=color)+ coord_cartesian(xlim = xlim, ylim = ylim, wise = wise)
scale_colour_manual(values=color)+ coord_cartesian(xlim = xlim, ylim = ylim)
)
}
}
Expand Down
1 change: 0 additions & 1 deletion R/climate_refclass.R
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,6 @@ climate$methods(summary_calculation = function(data_list = list(), summary_time_
}

curr_required_variables = list()
print(required_variables)
for(var in required_variables) {
curr_required_variables[[length(curr_required_variables)+1]] = data_obj$getvname(var)
#curr_required_variables[[length(curr_required_variables)+1]] = data_obj$getvname(var)
Expand Down

0 comments on commit 30fdd9b

Please sign in to comment.