Running examples in ‘lessR-Ex.R’ failed
The error most likely occurred in:

> ### Name: Plot
> ### Title: Plot One or Two Continuous and/or Categorical Variables
> ### Aliases: Plot ScatterPlot sp
> ### Keywords: plot color grouping variable
> 
> ### ** Examples
> 
> # read the data
> mydata <- rd("Employee", format="lessR", quiet=TRUE)

> mydata <- Subset(random=.4, quiet=TRUE)  # less computationally intensive
> # many examples commented out to reduce CPU time for the CRAN submission
> 
> #---------------------------------------------------
> # traditional scatterplot with two numeric variables
> #---------------------------------------------------
> 
> # scatterplot with all defaults
> Plot(Years, Salary)
dev.new(): using pdf(file="Rplots137.pdf")

>>> Suggestions
Plot(Years, Salary, ellipse=0.95, ellipse.fill="off", fit=TRUE) 
Plot(Years, Salary, ID.cut=.10)  # label top 10% potential outliers
Plot(Years, Salary, fit.se=1:3)  # fit line with standard errors of 1, 2 and 3
Plot(Years, Salary, ellipse=seq(.25, .95, .10), size=0)  # no points, shaded ellipses
Plot(Years, Salary, size=2, shape="diamond", bg="off", grid="off") 
Plot(Years, Salary, smooth=TRUE, fit="ls")  # smoothed plot, least-squares fit line 


>>> Pearson's product-moment correlation 
 
Years: Time of company employment 
Salary: Annual salary 
 
Number of paired values with neither missing, n = 14 


Sample Correlation of Years and Salary: r = 0.861 


Alternative Hypothesis: True correlation is not equal to 0 
  t-value: 5.852,  df: 12,  p-value: 0.000 
 
95% Confidence Interval of Population Correlation 
  Lower Bound: 0.607      Upper Bound: 0.955 


> # or use abbreviation sp in place of Plot
> 
> # new shape and point size, no grid or background color
> # Plot(Years, Salary, size=2, shape="diamond", bg.fill="off"="off")
> 
> # bubble plot with size determined by the value of Pre
> # display the value for the bubbles with values of  min, median and max
> # Plot(Years, Salary, size=Pre, size.cut=3)
> 
> # plot 0.95 data ellipse with the points identified that represent
> #  the 0.10 largest Mahalanobis distances (i.e., potential outliers)
> # Plot(Years, Salary, ellipse=0.95, ID.cut=0.1)
> 
> # variables of interest are in a data frame not the default mydata
> # plot 0.6 and 0.9 data ellipses
> # change color theme to gold with black background
> style("gold", sub.theme="black")
> Plot(eruptions, waiting, ellipse=seq(.6,.9), data=faithful)
[Ellipse with Murdoch and Chow's function ellipse from the ellipse package]
dev.new(): using pdf(file="Rplots138.pdf")

>>> Suggestions
Plot(eruptions, waiting, data=faithful, ellipse=seq(0.6, 0.9), ellipse.fill="off", fit=TRUE) 
Plot(eruptions, waiting, data=faithful, ellipse=seq(0.6, 0.9), ID.cut=.10) 
Plot(eruptions, waiting, data=faithful, ellipse=seq(0.6, 0.9), fit.se=1:3) 
Plot(eruptions, waiting, data=faithful, ellipse=seq(0.6, 0.9), size=0) 
Plot(eruptions, waiting, data=faithful, 0.9), size=2, shape="diamond", bg="off", grid="off") 
Plot(eruptions, waiting, data=faithful, 0.9), smooth=TRUE, fit="ls")  


>>> Pearson's product-moment correlation 
 
Number of paired values with neither missing, n = 272 


Sample Correlation of eruptions and waiting: r = 0.901 


Alternative Hypothesis: True correlation is not equal to 0 
  t-value: 34.089,  df: 270,  p-value: 0.000 
 
95% Confidence Interval of Population Correlation 
  Lower Bound: 0.876      Upper Bound: 0.921 


> 
> # translucent data ellipses without points or edges showing the
> #  idealized joint distribution assuming bivariate normality
> Plot(Years, Salary, size=0, ellipse=seq(.1,.9,.10), ellipse.stroke="off")
[Ellipse with Murdoch and Chow's function ellipse from the ellipse package]
dev.new(): using pdf(file="Rplots139.pdf")

>>> Suggestions
Plot(Years, Salary, size=0, ellipse=seq(0.1, 0.9, 0.1), ellipse.stroke="off", ellipse.fill="off", fit=TRUE) 
Plot(Years, Salary, size=0, ellipse=seq(0.1, 0.9, 0.1), ellipse.stroke="off", ID.cut=.10) 
Plot(Years, Salary, size=0, ellipse=seq(0.1, 0.9, 0.1), ellipse.stroke="off", fit.se=1:3) 
Plot(Years, Salary, size=0, 0.9, 0.1), ellipse.stroke="off", shape="diamond", bg="off", grid="off") 
Plot(Years, Salary, size=0, 0.9, 0.1), smooth=TRUE, fit="ls")  


>>> Pearson's product-moment correlation 
 
Years: Time of company employment 
Salary: Annual salary 
 
Number of paired values with neither missing, n = 14 


Sample Correlation of Years and Salary: r = 0.861 


Alternative Hypothesis: True correlation is not equal to 0 
  t-value: 5.852,  df: 12,  p-value: 0.000 
 
95% Confidence Interval of Population Correlation 
  Lower Bound: 0.607      Upper Bound: 0.955 


> 
> # scatterplot with two x-variables, plotted against Salary
> # define a completely new style, then back to default
> # style(device.fill=rgb(247,242,230, maxColorValue=255),
> #       bg.fill="off", bg.stroke="off", pt.fill="black", trans=0,
> #       lab.stroke="black", values.stroke="black",
> #       axis.y.stroke="off", grid.x.stroke="off", grid.y.stroke="black",
> #       grid.lty="dotted", grid.lwd=1)
> # Plot(c(Pre, Post), Salary)
> # style("lightbronze")
> 
> # increase span (smoothing) from default of .7 to 1.25
> # span is a loess parameter and generates a caution that can be
> #   ignored that it is not a graphical parameter -- we know that
> # Plot(Years, Salary, fit="loess", span=1.25)
> 
> # 2-D kernel density (more useful for larger sample sizes) 
> # Plot(Years, Salary, smoothed=TRUE)
> 
> 
> #------------------------------------------------------
> # scatterplot matrix from a vector of numeric variables
> #------------------------------------------------------
> 
> # with least squares fit line and color options
> Plot(c("Salary", "Years", "Pre"), fit="ls", bg.fill="powderblue", fit.stroke="red")
dev.new(): using pdf(file="Rplots140.pdf")
> 
> 
> #--------------------------------------------------------------
> # Trellis graphics and by for groups with two numeric variables
> #--------------------------------------------------------------
> 
> # Trellis plot with condition on 1-variable
> Plot(Years, Salary, by1=Dept)
[Trellis graphics with Deepayan Sarkar's lattice package]

dev.new(): using pdf(file="Rplots141.pdf")
> 
> # Trellis plot with condition on 2-variables and groups
> Plot(Years, Salary, by1=Dept, by2=Gender, fit="ls", by=HealthPlan)
[Trellis graphics with Deepayan Sarkar's lattice package]

dev.new(): using pdf(file="Rplots142.pdf")
> 
> # vary both shape and color with a least-squares fit line for each group
> # Plot(Years, Salary, by1=Gender, fit="ls", 
> #     color=c("darkgreen", "brown"), shape=c("F","M"), size=.8)
> 
> # compare the men and women Salary according to Years worked
> # Plot(Years, Salary, by=Gender, ellipse=.50)
> 
> 
> #--------------------------------------------------
> # analysis of a single numeric variable (or vector)
> #--------------------------------------------------
> 
> # 1-variable scatterplots
> # ------------------------
> # 1-variable scatterplot, continuous
> # custom colors for outliers
> Plot(Salary, out15="hotpink", out30="darkred")
dev.new(): using pdf(file="Rplots143.pdf")

>>> Suggestions
Plot(Salary, out30="darkred", out15="hotpink", means=FALSE) 
Plot(Salary, out30="darkred", out15="hotpink", size=2) 
Plot(Salary, out30="darkred", out15="hotpink", boxplot=TRUE) 
Plot(Salary, values="count")
Plot(Salary, values="count", area=TRUE)  


--- Salary: Annual salary ---
 
 
      n   miss         mean           sd          min          mdn          max 
     15      0    69870.967    24448.437    39704.790    62502.500   124419.230 


No (Box plot) outliers 

> 
> # one variable scatterplot with added jitter of points and a boxplot
> # Plot(Salary, method="jitter", boxplot=TRUE)
> 
> # binned values to plot counts
> # ----------------------------
> # bin the values of Salary to plot counts as a frequency polygon
> # Plot(Salary, values="count")  # bin the values
> 
> # time charts
> #------------
> # run chart, with fill area
> Plot(Salary, run=TRUE, area="steelblue")
dev.new(): using pdf(file="Rplots144.pdf")

>>> Suggestions
Plot(Salary, run=TRUE, area="steelblue", size=0)  # just line segments, no points
Plot(Salary, run=TRUE, area="steelblue", line.width=0)  # just points, no line segments 

n: 15 
missing: 0 
median: 62502.5 

------------
Run Analysis
------------

size=1  Run 10:   15

Total number of runs: 10 
Total number of values that do not equal the median: 14

> 
> # two run charts in same plot
> # or could do a multivariate time series
> # Plot(c(Pre, Post), run=TRUE)
> 
> # Trellis graphics run chart with custom line width
> # Plot(Salary, run=TRUE, by1=Gender, lwd=3)
> 
> # daily time series plot
> # create the daily time series from R built-in data set airquality
> # oz.ts <- ts(airquality$Ozone, start=c(1973, 121), frequency=365)
> # Plot(oz.ts)
> 
> # multiple time series plotted from dates and stacked
> # black background with translucent areas
> # date <- seq(as.Date("2013/1/1"), as.Date("2016/1/1"), by1="quarter")
> # x1 <- rnorm(13, 100, 15)
> # x2 <- rnorm(13, 100, 15)
> # x3 <- rnorm(13, 100, 15)
> # df <- data.frame(date, x1, x2, x3)
> # Plot(date, x1:x3, data=df, area="steelblue3", stroke="steelblue2",
> #      trans=.55, bg.fill="gray10"="gray25")
> 
> 
> #------------------------------------------
> # analysis of a single categorical variable
> #------------------------------------------
> 
> # default 1-D bubble plot
> # frequency plot, replaces bar chart 
> Plot(Dept)
dev.new(): using pdf(file="Rplots145.pdf")
Warning in max(nchar(colnames(x))) :
  no non-missing arguments to max; returning -Inf
Error in FUN(newX[, i], ...) : invalid 'type' (character) of argument
Calls: Plot ... .plt.txt -> .ss.factor -> addmargins -> expand.one -> apply
Execution halted