plotLUMAdata: Plot raw or processed LUMA data for multiple variables.

Description Usage Arguments Value Examples

View source: R/plotLUMAdata.R

Description

Plot raw or processed LUMA data for multiple variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
plotLUMAdata(
  instrument,
  level,
  startDate,
  endDate,
  variables,
  fileTimeRes = NA,
  sep = NA,
  variableColNos = NA,
  timeColFormat = NA,
  skipRows = 0,
  DRIVE = NULL,
  tickBreaks = NA,
  dateLabelFormat = NA,
  title = NA,
  SAVEplot = FALSE,
  SAVEname = NA,
  SAVEpath = NULL,
  SAVEsize = NA
)

Arguments

instrument

A list containing the instrument name an site in the form list(id = "INSTID", site = "SITENAME"). INSTID and SITENAME should be consistent with the LUMA metadata system. 'ECpack' can also be included with a boolean.

level

The quality level of the data. Either "RAW" or an integer.

startDate, endDate

Start and end date of plot. Should be of class date.

variables

A string or vector of strings of the variables to plot. These must be consisted with variables on LUMA metadata website.

fileTimeRes

Time resolution of file this should be consistent with file names on the cluster e.g. 1min. Only needed when level is not RAW.

sep

If data is RAW then what is data separated by e.g. ','.

variableColNos

If data is RAW then a vector of the position of the variable to be plotted.

timeColFormat

The format of time columns. A string or vector of strings if multiple time columns.

skipRows

How many rows to skip when reading raw file. Default is none.

DRIVE

If running on windows which drive is /storage/basic/micromet mapped to e.g. Z

tickBreaks

How often ticks should appear on plots. e.g. 6 hours. See https://www.rdocumentation.org/packages/ggplot2/versions/1.0.0/topics/scale_x_datetime date_breaks for valid options.

dateLabelFormat

The format of date labels e.g. with Hour and Minute separated by : . See date_labels in link above for valid options.

title

The title of the plot. If not specified then a default will be generated based on information given.

SAVEplot

Boolean whether to save the plot.

SAVEname

The name of the plot if SAVEplot = TRUE

SAVEpath

The path to folder in which plot should be saved. Leave as null to save in current working directory.

SAVEsize

The size the save the image. This is a 3D vector consisting of h (height), w (width) and unit. See https://ggplot2.tidyverse.org/reference/ggsave.html for valid units.

Value

A plot of the of the variables for the instrument specifed between startDate and endDate. Optionally, it will save this plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#plot a from RAW data
# set up arguments
instrument <- list(id = 'SWTWXSTATION',  site = 'SWT')
level <- 'RAW'
startDate = as.Date('2020-030', format = '%Y-%j')
endDate = as.Date('2020-031', format = '%Y-%j')
fileTimeRes = '1min'
variables = c('Tair', 'dir', 'RH')
sep <- ','
variableColNos <- c(2, 9, 10)
timeColFormat <- '%Y-%m-%d %H:%M:%S'
tickBreaks <- '6 hours'
dateLabelFormat <- '%j %H:%M'
#create the plot
RAWplot <- plotLUMAdata(instrument, level, startDate, endDate, variables, fileTimeRes,
                        sep, variableColNos, timeColFormat, tickBreaks, dateLabelFormat)

#plot processed netcdf data and save it automatically, manually specifying the title
level = 1
title = 'A plot of level 1 processed data'
SAVEname = 'Level1.png'
SAVEpath = 'imgs'
SAVEsize = c(h = 7.23, w = 7.56, unit = 'in'
#this will save plot in imgs folder with a height and width of 7.23 and 7.56 inches, repsectively
L1plot <- plotLUMAdata(instrument, level, startDate, endDate, variables, fileTimeRes,
                       title = title, SAVEplot = TRUE, SAVEname = SAVEname, SAVEpath = SAVEpath,
                       SAVEsize = SAVEsize)

Urban-Meteorology-Reading/analysisToolsLUMA documentation built on June 8, 2021, 6:29 p.m.