Package JBTools. R topics documented: June 2, 2015

Similar documents
Package areaplot. October 18, 2017

Package desplot. R topics documented: April 3, 2018

Package EnQuireR. R topics documented: February 19, Type Package Title A package dedicated to questionnaires Version 0.

Package Grid2Polygons

Package imgur. R topics documented: December 20, Type Package. Title Share plots using the imgur.com image hosting service. Version 0.1.

Package sciplot. February 15, 2013

Package MmgraphR. R topics documented: September 14, Type Package

Package munfold. R topics documented: February 8, Type Package. Title Metric Unfolding. Version Date Author Martin Elff

Package RCA. R topics documented: February 29, 2016

Package cgh. R topics documented: February 19, 2015

Package Mondrian. R topics documented: March 4, Type Package

Package seg. February 15, 2013

Package mixphm. July 23, 2015

Package DPBBM. September 29, 2016

Package logitnorm. R topics documented: February 20, 2015

Matrix algebra. Basics

Package edci. May 16, 2018

Package pca3d. February 17, 2017

Package mixexp. February 15, 2013

Package bdots. March 12, 2018

Package GCAI.bias. February 19, 2015

Package lmesplines. R topics documented: February 20, Version

Package qicharts. October 7, 2014

Package iterators. December 12, 2017

Package panelview. April 24, 2018

Package gains. September 12, 2017

Package fso. February 19, 2015

Package Binarize. February 6, 2017

Package SSRA. August 22, 2016

Package qrfactor. February 20, 2015

Package beanplot. R topics documented: February 19, Type Package

Package hbm. February 20, 2015

Package waterfall. R topics documented: February 15, Type Package. Version Date Title Waterfall Charts in R

Package seg. September 8, 2013

Package penrvine. R topics documented: May 21, Type Package

Package SCVA. June 1, 2017

Package GLDreg. February 28, 2017

AA BB CC DD EE. Introduction to Graphics in R

Package spd. R topics documented: August 29, Type Package Title Semi Parametric Distribution Version Date

Package osrm. November 13, 2017

Package rtsplot. September 15, 2018

Package slam. February 15, 2013

Package clustering.sc.dp

Package sankey. R topics documented: October 22, 2017

Package xroi. February 13, 2019

Package slam. December 1, 2016

Package superbiclust

Package ConvergenceClubs

Package weco. May 4, 2018

Package MDSGUI. February 19, 2015

Package intccr. September 12, 2017

Package pendvine. R topics documented: July 9, Type Package

Package smoothr. April 4, 2018

Package gridextra. September 9, 2017

Statistical Programming with R

Package dyncorr. R topics documented: December 10, Title Dynamic Correlation Package Version Date

Package TPD. June 14, 2018

Package RCEIM. April 3, 2017

Package ClustGeo. R topics documented: July 14, Type Package

Package r2d2. February 20, 2015

The nor1mix Package. June 12, 2007

Package LSDinterface

Package naivebayes. R topics documented: January 3, Type Package. Title High Performance Implementation of the Naive Bayes Algorithm

Graphics - Part III: Basic Graphics Continued

Package JOP. February 19, 2015

The nor1mix Package. August 3, 2006

Plotting Complex Figures Using R. Simon Andrews v

Package pathdiagram. R topics documented: August 29, 2016

Package multigraph. R topics documented: January 24, 2017

Package replicatedpp2w

Package splines2. June 14, 2018

Package ExceedanceTools

Package crochet. January 8, 2018

Package Numero. November 24, 2018

Package truncreg. R topics documented: August 3, 2016

Package grimport. R topics documented: February 20, 2015

Package rknn. June 9, 2015

Package feature. R topics documented: July 8, Version Date 2013/07/08

Package Rramas. November 25, 2017

Package rivernet. May 12, 2017

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package multigraph. R topics documented: November 1, 2017

Package corclass. R topics documented: January 20, 2016

Package DiffCorr. August 29, 2016

Package NetCluster. R topics documented: February 19, Type Package Version 0.2 Date Title Clustering for networks

Package distrteach. R topics documented: January 20, Version 2.3 Date

Package meshsimp. June 13, 2017

Package orloca. April 21, Type Package Depends methods, png, ucminf Suggests grdevices, graphics, knitr VignetteBuilder knitr

Package orthogonalsplinebasis

Package nonmem2r. April 5, 2018

Package enpls. May 14, 2018

R Graphics. Paul Murrell. The University of Auckland. R Graphics p.1/47

Package MatrixCorrelation

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package cardidates. February 15, 2013

Package EMC. February 19, 2015

Package R2SWF. R topics documented: February 15, Version 0.4. Title Convert R Graphics to Flash Animations. Date

R literacy for digital soil mapping. Part 8

Package abf2. March 4, 2015

The som Package. September 19, Description Self-Organizing Map (with application in gene clustering)

Transcription:

Package JBTools June 2, 2015 Title Misc Small Tools and Helper Functions for Other Code of J. Buttlar Version 0.7.2.9 Date 2015-05-20 Author Maintainer <jbuttlar@bgc-jena.mpg.de> Collection of several tools and helper functions used across the other packages of J. Buttlar ('ncdf.tools' and 'spectral.methods'). Imports foreach, parallel, gplots, colorspace, plotrix Suggests domc License GPL-2 LazyLoad yes Depends R (>= 2.14.0) Repository CRAN Repository/R-Forge/Project jbtools Repository/R-Forge/Revision 33 Repository/R-Forge/DateTimeStamp 2015-06-01 10:53:23 Date/Publication 2015-06-02 00:07:07 NeedsCompilation no R topics documented: JBTools-package...................................... 2 checkinstalled........................................ 3 colorchangedarkness.................................... 3 convertargs2string..................................... 4 getsysinfo.......................................... 4 getvecinfo.......................................... 5 indexdimvecs2matrix................................... 6 indexvec2matrix...................................... 6 1

2 JBTools-package isseriesconstant....................................... 7 isseriescontinuous..................................... 7 labelmargins........................................ 8 MEF............................................. 9 plotbg............................................ 9 plotcolorscale....................................... 10 plotimagerotated...................................... 11 plotnlines......................................... 12 printstatus.......................................... 13 rangezeroequi....................................... 14 registerparallel....................................... 14 RMSE............................................ 15 seqlength.......................................... 16 seqlongest......................................... 17 usercoords......................................... 17 whichclosest........................................ 18 Index 19 JBTools-package Misc Small Tools and Helper Functions for Other Code of J. Buttlar Collection of several tools and helper functions used across the other packages of J. Buttlar ( ncdf.tools and spectral.methods ). Package: JBTools Title: Misc Small Tools and Helper Functions for Other Code of J. Buttlar Version: 0.7.2.8 Date: 2015-05-20 Author: Maintainer: <jbuttlar@bgc-jena.mpg.de> Imports: foreach, parallel, gplots, colorspace, plotrix Suggests: domc License: GPL-2 LazyLoad: yes Depends: R (>= 2.14.0)

checkinstalled 3 checkinstalled Check whether a command can be invoked via the command line checkinstalled checks whether an external command can be run on the command line. checkinstalled(commandname) commandname character string: name of the program/command to check The test is a simple wrapper around Sys.which which returns TRUE if which returns a character string and FALSE if not. logical: whether the program is installed. colorchangedarkness Change the dark/brightness of a color Function to yield darker or brighter variants of the same color by mixing this color with white or black colorchangedarkness(col, factor) col factor color to change. Can be a R color name or a hexadecimal color specification decimal factor to darken/brighten the color with. s < 1 lead to darker colors, values > 1 to brighter colors.

4 getsysinfo hexadecimal code for the new color. See Also mixcolor convertargs2string Save function argument values to a character string convertargs2strings saves function argument settings to a character string. details «convertargs2strings saves function argument settings to a character string. This is used in the ncdf routines that save these argument values as attributes of the target ncdf files. convertargs2string() character string: arguments given to function converted into a string. getsysinfo Compile system information getsysinfo is a convenience function to compile some information about the computing system and environment used. getsysinfo()

getvecinfo 5 The function is mainly used to save the system environment information in ncdf files containing the results of some calculations. character string with all version and system information of the current R system getvecinfo Compute vector summary statistics This function computes several summary statistics of a vector. getvecinfo(x) x vector with the vector statistics (min, max, mean, sdev, range, ratio na, ratio na inner, ratio INF)

6 indexvec2matrix indexdimvecs2matrix Transform integer indices to an index matrix Transform integer indices to an index matrix. The input have to be index vector for each dimension of the target array. Extract, indexvec2matrix indexdimvecs2matrix(...)... integer vectors: indices to use for the different dimensions Index matrix indexvec2matrix Transform a vector index to an index matrix Transform an index vector into a index matrix. Extract indexvec2matrix(index, dim) index dim vector index length of the two dimensions of the array to index. Identical to the result of dim(array). index array

isseriesconstant 7 isseriesconstant Check whether a vector is constant isseriesconstant checks whether a series is constant (up to a certain degree). isseriesconstant(x, tresh.const = 1e-12, ratio.const = 0.05) x tresh.const ratio.const numeric vector: series to test. numeric: maximum deviation allowed which is still considered to be constant. numeric: ratio of the series which is allowed to be not constant for the whole series to be still considered to be constant. isseriesconstant checks whether the amount of values deviating from the median of x for a higher value than tresh.const is bigger than ratio.const. logical: TRUE if series is constant, FALSE otherwise. isseriescontinuous Test for continuous (non NA interrupted) series isseriescontinuous test whether a vector contains one non interrupted sequence of values (i.e. no NaN in between). isseriescontinuous(x) x numeric vector: series to test

8 labelmargins The function returns TRUE when the vector contains one (and only one) non NA interupted sequence of values. E.g. it would also return TRUE for a vector that contains a sequence of NAs at the beginning and/or end of the vector. logical: whether the series contains gaps or not. labelmargins Label the margins of a plot Writes equidistant labels to the margins of a plot. labelmargins(labels, side = 1,...) labels character vector: labels to use side integer: side of the plot to label... further arguments passed to the plotting routines nothing is returned

MEF 9 MEF Compute the modelling efficiency (MEF) Calculates the modelling efficiency (MEF) of two arrays MEF(prediction, observation) prediction numeric: array 1 observation numeric: array 2 MEF of the two vectors plotbg Plot a colored plot background plotbg colors the plot background of the plot region (not the device region!). plotbg(color, exp.factor = 1, xlim = c(), ylim = c(),...) color color: which color to use exp.factor integer:possible expansion factor to use if very high values are plotted xlim ylim... further arguments passed to plot()

10 plotcolorscale The function opens a plot with no content and plots a very large polygon of the given color. Afterwards a new high level plot can be plotted over this background. Nothing is returned. plotcolorscale Add a color scale to plots plotcolorscale is a wrapper function around color.legend to ease its usage. plotcolorscale(col, zlim = c(), pos = list(x = c(1.02, 1.08), y = c(0.1, 0.9)), align = "rb", gradient = "y", cex = 1, cex.title = 1, title = "cts/px", outer.range = c(false, FALSE), legend = c()) col zlim pos align gradient cex cex.title title outer.range legend vector of color strings defining the palette to use numeric vector (of length 2) defining the upper and lower limit of the values mapped to the color scale. character: alignment option passed to color.legend character: orientation option passed to color.legend numeric: character expansion factor for the text labels character: the title of the color scale logical: whether to extend the scale over the zlim borders at its bottom and top. Nothing is returned.

plotimagerotated 11 See Also color.legend plotimagerotated Plot a rotated image plot plotimagerotated plots a raster/matrix using image() but supplying a rotated version of the matrix, i.e. it plots the matrix as it printed on the screen. plotimagerotated(data, col.vals = c(), row.vals = c(), scale = TRUE, col = heat.colors(20), zlim = range(data, na.rm = TRUE), title = "", useraster = TRUE, xlab = "", ylab = "",...) data col.vals row.vals scale col zlim title useraster xlab ylab matrix: data to be plotted numeric vector: coordinate values for the columns of data numeric vector: coordinate values for the rows of data logical: whether to plot a color scale besides the plot color vector: colors to create the color scale. numeric vector (length two): outer limits of the color-scale. s above or below this range are colored brighter/darker than the maximum/minimum color (see?plotcolorscale). character string: title of the color legend argument passed to image() to decide whether to draw polygons (FALSE) or use a bitmap raster (TRUE).... further arguments passed to image The normal image() function always plots a rotated version of a matrix. This function rotates the input to image in a way that the first entry of the matrix (col=1, row=1) shows up at the top-left corner of the plot. In other words the way a matrix would be displayed by printing it directly mapped to the plot.

12 plotnlines Nothing is returned. See Also image, plotcolorscale, the plotting routines of the raster package plotnlines Plot many lines in one plot plotnlines function uses different techniques to visualize many line plots on one display. plotnlines(x.data = matrix(1:dim(y.data)[2], ncol = dim(y.data)[2], nrow = dim(y.data)[1], byrow = TRUE), y.data, option = c("normal", "diff.scales", "stacked")[1], n.lines.max = 30, grid = FALSE, scale = 1, plot.scale = TRUE, function.add = function() (1), bgc = "white", pch.axlink = 1, type = "l", colors = c(), xlim = c(), ylim = c(), xlab = c(), ylab = c(), labels = c(), lty = 1, title, yaxt = "s",...) x.data y.data option n.lines.max grid scale plot.scale function.add bgc pch.axlink numeric matrix/data frame: y-values with one series of values per row character: which type of plot to use (see details) integer: only for stacked plots : how many lines to draw per panel logical: only for stacked plots : whether to draw a primitive grid numeric: only for stacked plots : scale factor to scale the y scale of the stacked plots TRUE: only for stacked plots : whether to add a small scale showing the y axis scale function: only for stacked plots : function to call after plotting the individual panels color: color of the plot background integer: only for stacked plots : pch value for the symbol that links each line to its x-axis

printstatus 13 type colors xlim ylim xlab ylab labels lty title yaxt standard plotting parameter colors to use for the different series standard plotting parameter standard plotting parameter standard plotting parameter standard plotting parameter standard plotting parameter standard plotting parameter standard plotting parameter standard plotting parameter... further arguments passed to the plot() calls Many parameters are identical to standard plotting parameters (see?par,?plot) and are not explained here. The function offers three options: normal : plots all plots in one coordinate system colored according to colors diff scales : plots all plots in the same region but uses different y axis scales. The visibility may be limited to ~7 plots. stacked : plots many plots in one region, all shifted vertically a bit to increase visibility. This allows for the easy comparison of many similar plots (e.g. time series) but reduces the details that are visible. printstatus Print a status message This function prints a given string as a status report to the screen together with the current time. printstatus(string.in) string.in character string: status message to print Nothing is returned but a message is printed to the screen.

14 registerparallel rangezeroequi Compute a zero centered equi-sided range rangezeroequi computes a zero centered equi-sided range, i.e. it the maximum absolute value and returns this as a positive and a negative value. rangezeroequi(x) x input vector vector registerparallel Set up a parallel computing front end This function automatically sets up a cluster in a consistent way way for different parallel computing packages. registerparallel(pckg.parallel = "domc", max.cores = 0) pckg.parallel max.cores character string: Package to use for parallel computing. Has to be (for the time beeing) one of domc or doparallel. integer: amount of cores to use registerparallel sets up a cluster object of the selected package. In principle, this is a simple wrapper around the cluster creating functions of these packages that provides a unified usage.

RMSE 15 For "domc": the amount of cores and for doparallel: the cluster object created. See Also foreach, registerdomc RMSE Compute the residual mean square error (RMSE) Calculates the residual mean square error (RMSE) of two arrays RMSE(prediction, observation) prediction numeric: array 1 observation numeric: array 2 RMSE of the two vectors

16 seqlength seqlength Determine lengths of sequences of identical elements The function returns a vector indicating the length of sequences of identical elements or elements of an identical type in a vector. seqlength(array_in, funct.seq = is.na) array_in funct.seq numeric: input vector string or name of a function: name of the function to use. Has to return TRUE for elements belonging to the sequence and FALSE otherwise The function returns a vector of the same length as the input vector indicating for each element in array_in how long the sequence of similar elements this value belongs to id. Zero indicates that identical values (or types) in the neighbourhood of the value. This process helps to indicate for example long gaps in timeseries. numeric vector of the same length as the input vector indicating the gap length for each single element See Also seqlongest

seqlongest 17 seqlongest find longest sequence of TRUEs The function determines the first position and the length of the longest uninterupted series of TRUEs in a logical sequence. This for example can be used to find gapless positions in a series seqlongest(array_in, na.rm = FALSE) array_in na.rm logical vector: input vector logical: if TRUE, NAs are tretaed as FALSE usercoords Transfer relative to actual plot coordinate values usercoords transfers realtive coordinate values (i.e. values between 0 and 1) to the actual coordinate system of the plot. usercoords(x = c(), y = c()) x y numeric vector(0-1): relative coordinates on the x axis numeric vector(0-1): relative coordinates on the y axis x and y need to be values between 0 and 1. These values are then mapped to the coordinates used in the current plot. list with x and/or y component with values in the current coordinate system

18 whichclosest Examples plot(1:10) text.coords <- usercoords(x=c(0.1,0.5),y=c(0.9,0.5)) text(text.coords,labels=c( 1st Text, 2nd Text )) whichclosest Find closest matches in two vectors Function to find closest matches of vector A in vector B and return the respective indices. whichclosest(x, x.match, arr.ind = FALSE) x x.match arr.ind numeric vector: values that should be found in x.match numeric vector: values the values of x should be matched against integer vector: indices of the closest element of x.match to each entry in x

Index Topic package JBTools-package, 2 checkinstalled, 3 color.legend, 11 colorchangedarkness, 3 convertargs2string, 4 usercoords, 17 whichclosest, 18 Extract, 6 foreach, 15 getsysinfo, 4 getvecinfo, 5 image, 12 indexdimvecs2matrix, 6 indexvec2matrix, 6, 6 isseriesconstant, 7 isseriescontinuous, 7 JBTools (JBTools-package), 2 JBTools-package, 2 labelmargins, 8 MEF, 9 mixcolor, 4 plotbg, 9 plotcolorscale, 10, 12 plotimagerotated, 11 plotnlines, 12 printstatus, 13 rangezeroequi, 14 registerdomc, 15 registerparallel, 14 RMSE, 15 seqlength, 16 seqlongest, 16, 17 19