Skip to content

Commit

Permalink
export functions correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
cas committed Jan 18, 2019
1 parent 50e5132 commit 2db8cfe
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 45 deletions.
10 changes: 5 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Generated by roxygen2: do not edit by hand

S3method(plot,Grid)
S3method(plot,Stn)
S3method(plot,heat)
S3method(plot,kde2d.hist)
S3method(plot,ts)
export(data.agg)
export(plot.Grid)
export(plot.Stn)
export(plot.TimeSeries)
export(plot.heat)
export(plot.kde2d.hist)
import(HeatStress)
import(MASS)
import(RColorBrewer)
Expand Down
2 changes: 1 addition & 1 deletion R/plot.Grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' @param export.format "png" or "pdf" format.
#' @param lon.points vector of longitudes for grid points to be marked in the map.
#' @param lat.points vector of latitudes for grid points to be marked in the map.
#' @export
#' @export plot.Grid
#' @details Packages classInt and maps needed.
#' @import classInt maps
#' @author Ana Casanueva (24.05.2017)
Expand Down
2 changes: 1 addition & 1 deletion R/plot.Stn.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#' @param export logical. If TRUE, the figure is exported as pdf file. Default: False.
#' @param export.path path (including file name) to save the plot.
#' @param export.format "png" or "pdf" format.
#' @export
#' @export plot.Stn
#' @details Packages classInt and maps needed.
#' @import classInt maps
#' @author Ana Casanueva (17.02.2017)
Expand Down
28 changes: 14 additions & 14 deletions R/plot.ts.R → R/plot.TimeSeries.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @inheritParams plot.ts.orig
#' @return A time series plot. Plotted data if 'output.data'=TRUE.
#' @details Plot time series of one vector. It is possible to plot the "raw" series or aggregate it temporarily or display a specific season/month. If the input data is a matrix, by default a separate panel is obtained for each station. 'stn.together' allows to plot all stations together (without subplot).
#' @export
#' @export plot.TimeSeries
#' @import grDevices graphics
#' @examples \dontrun{
#'# Generate some data
Expand All @@ -22,30 +22,30 @@
#'data.day <- array(runif(length(dates.day)*2, -5, 30), dim=c(length(dates.day),2))
#'data.hour <- array(runif(length(dates.hour)*2, -5, 30), dim=c(length(dates.hour),2))
#'# Plot original data
#'plot.ts(data.day, dates.day, title = c("Original daily data"))
#'plot.ts(data.day, dates.day, title = c("Original hourly data"), hour=T)
#'plot.TimeSeries(data.day, dates.day, title = c("Original daily data"))
#'plot.TimeSeries(data.day, dates.day, title = c("Original hourly data"), hour=T)
#'# Plot temporarily aggregated data
#'plot.ts(data.day, dates.day, title = "Yearly data", agg="Y")
#'plot.ts(data.day, dates.day, title = "Monthly data", agg="M")
#'plot.ts(data.day, dates.day, title = "Seasonal data", agg="S")
#'plot.ts(data.hour, dates.hour, hour=T, title = "Daily data", agg="D")
#'plot.TimeSeries(data.day, dates.day, title = "Yearly data", agg="Y")
#'plot.TimeSeries(data.day, dates.day, title = "Monthly data", agg="M")
#'plot.TimeSeries(data.day, dates.day, title = "Seasonal data", agg="S")
#'plot.TimeSeries(data.hour, dates.hour, hour=T, title = "Daily data", agg="D")
#'# Plot a specific season or month
#'plot.ts(data.day, dates.day, title = "Seasonal data in summer", season = c(6,7,8))
#'plot.ts(data.day, dates.day, title = c("Monthly data in June A", "Monthly data in June B"),
#'plot.TimeSeries(data.day, dates.day, title = "Seasonal data in summer", season = c(6,7,8))
#'plot.TimeSeries(data.day, dates.day, title = c("Monthly data in June A", "Monthly data in June B"),
#'season = 6) # and different subtitles
#'# Plot all stations together instead of in subplot
#'plot.ts(data.day, dates.day, title = "Monthly data in June A", season = 6, stn.together=T)
#'plot.TimeSeries(data.day, dates.day, title = "Monthly data in June A", season = 6, stn.together=T)
#'# Plot and save plotted data
#'res <- plot.ts(data.day, dates.day, title = "Monthly data in June", season = 6, output.data = T)
#'res <- plot.TimeSeries(data.day, dates.day, title = "Monthly data in June", season = 6, output.data = T)
#'# Export plot to file
#'plot.ts(data.day, dates.day, title = "Monthly data in June", season = 6, export = T)
#'plot.TimeSeries(data.day, dates.day, title = "Monthly data in June", season = 6, export = T)
#'# Change window size
#'plot.ts(data.day, dates.day, title = "Monthly data in June", season = 6,
#'plot.TimeSeries(data.day, dates.day, title = "Monthly data in June", season = 6,
#'window.width = 8, window.height = 4)
#'}


plot.ts <-
plot.TimeSeries <-

function(data, dates, hour=FALSE, agg=NULL, aggFun="mean", season=NULL,
export=FALSE, outDir = "current", outNam = "plot1",outDev = "pdf", title=NULL, input.mch=FALSE,
Expand Down
2 changes: 1 addition & 1 deletion R/plot.heat.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' @details The two input variables of the desired index need to be provided, tas and either td or hu. Needed packages: HeatStress, RColorBrewer.
#' @import HeatStress RColorBrewer
#' @author Ana Casanueva, 13.12.2018
#' @export
#' @export plot.heat
#' @examples \dontrun{
#' # Generate data
#' tas <- rnorm(150, mean=15, sd=2)
Expand Down
2 changes: 1 addition & 1 deletion R/plot.kde2d.hist.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @return Plot with the 2-dimensional kernel densities and historgrams for the input variables.
#' @details The two-dimensional kernel density estimation is done with the function kde2d in package MASS.
#' @import MASS RColorBrewer
#' @export
#' @export plot.kde2d.hist
#' @author Ana Casanueva, 13.12.2018
#' @examples \dontrun{
#' # Generate data
Expand Down
3 changes: 2 additions & 1 deletion R/plotFun.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
#'
#' \item \code{plot.Stn}: Plot a map of stations.
#' \item \code{plot.Grid}: Plot a map of a regular grid.
#' \item \code{plot.ts}: Plot time series with or without temporal aggregation.
#' \item \code{plot.TimeSeries}: Plot time series with or without temporal aggregation.
#' \item \code{plot.kde2d.hist}: Plot a 2D Kernel density plot with the histograms of the marginal distributions.
#' \item \code{plot.heat}: Plot heat index as a function of the input variables.
#'
#'
#' Additional functions:
Expand Down
40 changes: 20 additions & 20 deletions man/plot.ts.Rd → man/plot.TimeSeries.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/plotFun.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2db8cfe

Please sign in to comment.