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 pl ScatterPlot sp BoxPlot bx ViolinPlot vp
> ### Keywords: plot color grouping variable
> 
> ### ** Examples
> 
> # read the data
> d <- rd("Employee", quiet=TRUE)

> d <- Subset(random=.6, quiet=TRUE)  # less computationally intensive
> 
> #---------------------------------------------------
> # traditional scatterplot with two numeric variables
> #---------------------------------------------------
> 
> # scatterplot with all defaults
> Plot(Years, Salary)
dev.new(): using pdf(file="Rplots137.pdf")

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


Sample Correlation of Years and Salary: r = 0.881 


Alternative Hypothesis: True correlation is not equal to 0 
  t-value: 8.316,  df: 20,  p-value: 0.000 
 
95% Confidence Interval of Population Correlation 
  Lower Bound: 0.730      Upper Bound: 0.950 



> # or use abbreviation sp in place of Plot
> # or use full expression ScatterPlot in place of Plot
> 
> # maximum information, minimum input: scatterplot +
> #  means, outliers, ellipse, least-squares lines with and w/o outliers
> Plot(Years, Salary, enhance=TRUE)
[Ellipse with Murdoch and Chow's function ellipse from the ellipse package]
dev.new(): using pdf(file="Rplots138.pdf")

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


Sample Correlation of Years and Salary: r = 0.881 


Alternative Hypothesis: True correlation is not equal to 0 
  t-value: 8.316,  df: 20,  p-value: 0.000 
 
95% Confidence Interval of Population Correlation 
  Lower Bound: 0.730      Upper Bound: 0.950 



>>> Outlier analysis with Mahalanobis Distance 
 
  MD                  ID 
-----               ----- 
6.76     Correll, Trevon 
6.54       Capelle, Adam 
 
4.95  Korhalkar, Jessica 
4.72       James, Leslie 
2.55      Billing, Susan 
...                 ... 

> 
> # extend x and y axes
> Plot(Years, Salary, scale_x=c(-10, 35, 10), scale_y=c(0,200000,10))
dev.new(): using pdf(file="Rplots139.pdf")

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


Sample Correlation of Years and Salary: r = 0.881 


Alternative Hypothesis: True correlation is not equal to 0 
  t-value: 8.316,  df: 20,  p-value: 0.000 
 
95% Confidence Interval of Population Correlation 
  Lower Bound: 0.730      Upper Bound: 0.950 



> 
> Plot(Years, Salary, add="Hi", x1=c(12, 16, 18), y1=c(80000, 100000, 60000))
dev.new(): using pdf(file="Rplots140.pdf")

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


Sample Correlation of Years and Salary: r = 0.881 


Alternative Hypothesis: True correlation is not equal to 0 
  t-value: 8.316,  df: 20,  p-value: 0.000 
 
95% Confidence Interval of Population Correlation 
  Lower Bound: 0.730      Upper Bound: 0.950 



> 
> 
> 
> #------------------------------------------------------
> # scatterplot matrix from a vector of numeric variables
> #------------------------------------------------------
> 
> # with least squares fit line
> Plot(c(Salary, Years, Pre), fit="lm")
dev.new(): using pdf(file="Rplots141.pdf")
> 
> 
> #--------------------------------------------------------------
> # Trellis graphics and by for groups with two numeric variables
> #--------------------------------------------------------------
> 
> # Trellis plot with condition on 1-variable
> # optionally re-order default alphabetical R ordering by converting
> #   to a factor with lessR factors (which also does multiple variables
> d$Gender <- factors(Gender, levels=c("M", "F"))
> Plot(Years, Salary, by1=Gender)
[Trellis graphics from Deepayan Sarkar's lattice package]
dev.new(): using pdf(file="Rplots142.pdf")
> 
> 
> #--------------------------------------------------
> # analysis of a single numeric variable (or vector)
> #--------------------------------------------------
> 
> # One continuous variable
> # -----------------------
> # integrated Violin/Box/Scatterplot, a VBS plot
> Plot(Salary)
[Violin/Box/Scatterplot graphics from Deepayan Sarkar's lattice package]

--- Salary --- 
Present: 22 
Missing: 0 
Total  : 22 
 
Mean         : 73774.604 
Stnd Dev     : 24555.798 
IQR          : 30018.262 
Skew         : 0.349   [medcouple, -1 to 1] 
 
Minimum      : 46124.970 
Lower Whisker: 46124.970 
1st Quartile : 56574.477 
Median       : 66325.360 
3rd Quartile : 86592.740 
Upper Whisker: 134419.230 
Maximum      : 134419.230 


No (Box plot) outliers 


Number of duplicated values: 0 


Parameter values (can be manually set) 
------------------------------------------------------- 
size: 0.68      size of plotted points 
jitter_y: 0.15  random vertical movement of points 
jitter_x: 0.00  random horizontal movement of points 
bw: 10865.23     set bandwidth higher for smoother edges 

dev.new(): using pdf(file="Rplots143.pdf")
> 
> 
> #------------------------------------------
> # analysis of a single categorical variable
> #------------------------------------------
> d <- rd("Employee")
Data Types
------------------------------------------------------------
character: Non-numeric data values
integer: Numeric data values, integers only
double: Numeric data values with decimal digits
------------------------------------------------------------

    Variable                  Missing  Unique 
        Name     Type  Values  Values  Values   First and last values
------------------------------------------------------------------------------------------
 1     Years   integer     36       1      16   7  NA  15 ... 1  2  10
 2    Gender character     37       0       2   M  M  M ... F  F  M
 3      Dept character     36       1       5   ADMN  SALE  SALE ... MKTG  SALE  FINC
 4    Salary    double     37       0      37   53788.26  94494.58 ... 56508.32  57562.36
 5    JobSat character     35       2       3   med  low  low ... high  low  high
 6      Plan   integer     37       0       3   1  1  3 ... 2  2  1
 7       Pre   integer     37       0      27   82  62  96 ... 83  59  80
 8      Post   integer     37       0      22   92  74  97 ... 90  71  87
------------------------------------------------------------------------------------------



> 
> # default 1-D bubble plot
> # frequency plot, replaces bar chart 
> Plot(Dept)
Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] : 
  non-numeric argument to binary operator
Calls: Plot -> diff -> diff.default
Execution halted