R Under development (unstable) (2023-07-07 r84657 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(BrailleR) Warning in .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version) : invalid non-character version specification 'x' (type: double) The BrailleR.View, option is set to FALSE. Attaching package: 'BrailleR' The following objects are masked from 'package:graphics': boxplot, hist The following object is masked from 'package:utils': history The following objects are masked from 'package:base': grep, gsub > library(ggplot2) > > # Add some factor variables to mtcars > m= within(mtcars,{am = as.factor(ifelse(am,"auto","manual")); cyl = as.factor(cyl)}) > > # qplot - exercise the various qplot parameters and geoms > # points, smoothing, log-transform, xlim > VI(qplot(data=m, disp,mpg, facets=.~am, margins=TRUE, + geom=c("point","smooth"), main="Cars, cars, cars", xlab="displacement", + ylab="Miles per gallon", log="y", xlim=c(90,450))) This chart has title 'Cars, cars, cars'. The chart is comprised of 3 panels containing sub-charts, arranged horizontally. The panels represent different values of am. Each sub-chart has x-axis 'displacement' with labels 100, 200, 300 and 400. Each sub-chart has y-axis 'Miles per gallon' with labels 10, 30 and 50. Each sub-chart has 2 layers. Panel 1 represents data for am = auto. Layer 1 of panel 1 is a set of 9 big solid circle points of which about 89% can be seen. The points are at: (160, 21), (160, 21), (108, 22.8), (120.3, 26), (95.1, 30.4), (351, 15.8), (145, 19.7), (301, 15) and (121, 21.4) Layer 2 of panel 1 is a 'lowess' smoothed curve with 95% confidence intervals covering 22% of the graph.Panel 2 represents data for am = manual. Layer 1 of panel 2 is a set of 17 big solid circle points of which about 100% can be seen. Layer 2 of panel 2 is a 'lowess' smoothed curve with 95% confidence intervals covering 22% of the graph.Panel 3 represents data for am = (all). Layer 1 of panel 3 is a set of 26 big solid circle points of which about 96% can be seen. Layer 2 of panel 3 is a 'lowess' smoothed curve with 95% confidence intervals covering 22% of the graph. Warning messages: 1: `qplot()` was deprecated in ggplot2 3.4.0. 2: Removed 12 rows containing non-finite values (`stat_smooth()`). > > # boxplot, title, subtitle & caption > VI(qplot(data=m, cyl, mpg, geom="boxplot") + + labs(title = "MPG by cyl",subtitle="for mtcars dataset",caption="some caption here")) This chart has title 'MPG by cyl'. It has the subtitle 'for mtcars dataset'. It has caption 'some caption here'. It has x-axis 'cyl' with labels 4, 6 and 8. It has y-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. The chart is a boxplot comprised of 3 vertical boxes with whiskers. There is a box at x=1. It has median 26. The box goes from 22.8 to 30.4, and the whiskers extend to 21.4 and 33.9. There are 0 outliers for this boxplot. There is a box at x=2. It has median 19.7. The box goes from 18.65 to 21, and the whiskers extend to 17.8 and 21.4. There are 0 outliers for this boxplot. There is a box at x=3. It has median 15.2. The box goes from 14.4 to 16.25, and the whiskers extend to 13.3 and 18.7. There are 1 max and 2 min outliers for this boxplot. > > # line, no annotation > VI(qplot(data=economics[1:8,], date, unemploy, geom="line")) This is an untitled chart with no subtitle or caption. It has x-axis 'date' with labels Jul, Oct and Jan. It has y-axis 'unemploy' with labels 2900, 2950, 3000, 3050, 3100 and 3150. The chart is a set of 1 line. Line 1 connects 8 points, at (1967-07-01, 2944), (1967-08-01, 2945), (1967-09-01, 2958), (1967-10-01, 3143), (1967-11-01, 3066), (1967-12-01, 3018), (1968-01-01, 2878) and (1968-02-01, 3001). > > # Add a horizontal line > VI(qplot(data=economics[1:20,], x=date, y=unemploy, geom="line") + + geom_hline(yintercept=3000, col="blue")) This is an untitled chart with no subtitle or caption. It has x-axis 'date' with labels 1967-07, 1968-01, 1968-07 and 1969-01. It has y-axis 'unemploy' with labels 2700, 2800, 2900, 3000 and 3100. It has 2 layers. Layer 1 is a set of 1 line. Line 1 connects 20 points. Layer 2 is 1 horizontal line as follows: Line at y position 3000. Layer 2 has colour set to vivid violet. > > # Set some constant aesthetics > VI(qplot(data=m, disp, mpg, shape=I("x"), size=I(5), alpha=I(0.3))) This is an untitled chart with no subtitle or caption. It has x-axis 'disp' with labels 100, 200, 300 and 400. It has y-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. The chart is a set of 32 x points of which about 91% can be seen. It has shape set to x. It has size set to 5. It has alpha set to 0.3. > > # With some variable aesthetics > VI(qplot(data=m[1:10,], disp, mpg, mapping=aes(shape=am,size=hp))) This is an untitled chart with no subtitle or caption. It has x-axis 'disp' with labels 100, 200 and 300. It has y-axis 'mpg' with labels 15.0, 17.5, 20.0 and 22.5. There is a legend indicating shape is used to show am, with 2 levels: auto shown as solid circle shape and manual shown as solid triangle shape. There is a legend indicating size is used to show hp, ranging from 62 represented by size 1 to 245 shown as size 6. The chart is a set of 10 points of which about 90% can be seen. The points are at: (160, 21) size 3.56 mm shape solid circle which maps to am = auto, (160, 21) size 3.56 mm shape solid circle which maps to am = auto, (108, 22.8) size 3.06 mm shape solid circle which maps to am = auto, (258, 21.4) size 3.56 mm shape solid triangle which maps to am = manual, (360, 18.7) size 4.93 mm shape solid triangle which maps to am = manual, (225, 18.1) size 3.42 mm shape solid triangle which maps to am = manual, (360, 14.3) size 6 mm shape solid triangle which maps to am = manual, (146.7, 24.4) size 1 mm shape solid triangle which maps to am = manual, (140.8, 22.8) size 3.12 mm shape solid triangle which maps to am = manual and (167.6, 19.2) size 3.89 mm shape solid triangle which maps to am = manual > > # Categorical axis with not all categories in all facets > VI(qplot(data=m, cyl, mpg) + facet_grid(.~round(disp/100), scales = "free")) This is an untitled chart with no subtitle or caption. The chart is comprised of 5 panels containing sub-charts, arranged horizontally. The panels represent different values of round(disp/100). There is no x-axis. There is no y-axis. Panel 1 represents data for round(disp/100) = 1. In this panel, x-axis 'cyl' has labels 4 and 6. In this panel, y-axis 'mpg' has labels 10, 15, 20, 25, 30 and 35. Panel 1 is a set of 12 big solid circle points of which about 83% can be seen. Panel 2 represents data for round(disp/100) = 2. In this panel, x-axis 'cyl' has labels 4 and 6. In this panel, y-axis 'mpg' has labels 10, 15, 20, 25, 30 and 35. Panel 2 is a set of 5 big solid circle points of which about 80% can be seen. The points are at: (6, 21), (6, 21), (6, 18.1), (6, 19.2) and (6, 17.8) Panel 3 represents data for round(disp/100) = 3. In this panel, x-axis 'cyl' has labels 4 and 6. In this panel, y-axis 'mpg' has labels 10, 15, 20, 25, 30 and 35. Panel 3 is a set of 7 big solid circle points of which about 86% can be seen. The points are at: (6, 21.4), (8, 16.4), (8, 17.3), (8, 15.2), (8, 15.5), (8, 15.2) and (8, 15) Panel 4 represents data for round(disp/100) = 4. In this panel, x-axis 'cyl' has labels 4 and 6. In this panel, y-axis 'mpg' has labels 10, 15, 20, 25, 30 and 35. Panel 4 is a set of 6 big solid circle points of which about 100% can be seen. The points are at: (8, 18.7), (8, 14.3), (8, 14.7), (8, 13.3), (8, 19.2) and (8, 15.8) Panel 5 represents data for round(disp/100) = 5. In this panel, x-axis 'cyl' has labels 4 and 6. In this panel, y-axis 'mpg' has labels 10, 15, 20, 25, 30 and 35. Panel 5 is a set of 2 big solid circle points of which about 50% can be seen. The points are at: (8, 10.4) and (8, 10.4) > > # Faceted histogram > VI(qplot(data=m, mpg, facets=.~cyl)) This is an untitled chart with no subtitle or caption. The chart is comprised of 3 panels containing sub-charts, arranged horizontally. The panels represent different values of cyl. Each sub-chart has x-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. Each sub-chart has y-axis '' with labels 0, 1, 2, 3, 4 and 5. Panel 1 represents data for cyl = 4. Panel 1 is a bar chart with 30 vertical bars. Panel 2 represents data for cyl = 6. Panel 2 is a bar chart with 30 vertical bars. Panel 3 represents data for cyl = 8. Panel 3 is a bar chart with 30 vertical bars. > > # Test all aesthetics for all supported plot types > # Note: These charts don't necessarily make sense, and some look disgusting. > # They're just to test printing all the aesthetic information > ### Points > VI(qplot(data=m[1:10,], mpg, disp, alpha=cyl, colour=mpg, fill=mpg, shape=I(20), size=disp)) This is an untitled chart with no subtitle or caption. It has x-axis 'mpg' with labels 15.0, 17.5, 20.0 and 22.5. It has y-axis 'disp' with labels 100, 200 and 300. There is a legend indicating alpha is used to show cyl, with 3 levels: 4 shown as 0.1 alpha, 6 shown as 0.55 alpha and 8 shown as 1 alpha. There is a legend indicating colour is used to show mpg, ranging from 14.3 represented by colour dark purplish blue to 24.4 shown as colour brilliant blue. There is a legend indicating fill is used to show mpg, ranging from 14.3 represented by fill dark purplish blue to 24.4 shown as fill brilliant blue. There is a legend indicating size is used to show disp, ranging from 108 represented by size 1 to 360 shown as size 6. The chart is a set of 10 small solid circle points of which about 90% can be seen. The points are at: (21, 160) size 3.27 mm colour brilliant blue fill brilliant blue alpha 0.55 which maps to cyl = 6, (21, 160) size 3.27 mm colour brilliant blue fill brilliant blue alpha 0.55 which maps to cyl = 6, (22.8, 108) size 1 mm colour brilliant blue fill brilliant blue alpha 0.1 which maps to cyl = 4, (21.4, 258) size 4.86 mm colour brilliant blue fill brilliant blue alpha 0.55 which maps to cyl = 6, (18.7, 360) size 6 mm colour moderate blue fill moderate blue alpha 1 which maps to cyl = 8, (18.1, 225) size 4.41 mm colour moderate blue fill moderate blue alpha 0.55 which maps to cyl = 6, (14.3, 360) size 6 mm colour dark purplish blue fill dark purplish blue alpha 1 which maps to cyl = 8, (24.4, 146.7) size 2.96 mm colour brilliant blue fill brilliant blue alpha 0.1 which maps to cyl = 4, (22.8, 140.8) size 2.8 mm colour brilliant blue fill brilliant blue alpha 0.1 which maps to cyl = 4 and (19.2, 167.6) size 3.43 mm colour moderate blue fill moderate blue alpha 0.55 which maps to cyl = 6 It has shape set to small solid circle. Warning message: Using alpha for a discrete variable is not advised. > ### Histogram > VI(qplot(data=m[1:10,], mpg, geom="histogram", bins=5, alpha=am, colour=am, fill=am, + linetype=am, size=am)) This is an untitled chart with no subtitle or caption. It has x-axis 'mpg' with labels 16, 20 and 24. It has y-axis '' with labels 0, 1, 2, 3 and 4. There is a legend indicating alpha is used to show am, with 2 levels: auto shown as 0.1 alpha and manual shown as 1 alpha. There is a legend indicating colour is used to show am, with 2 levels: auto shown as strong reddish orange colour and manual shown as brilliant bluish green colour. There is a legend indicating fill is used to show am, with 2 levels: auto shown as strong reddish orange fill and manual shown as brilliant bluish green fill. There is a legend indicating linetype is used to show am, with 2 levels: auto shown as solid linetype and manual shown as 22 linetype. There is a legend indicating size is used to show am, with 2 levels: auto shown as 2 size and manual shown as 6 size. The chart is a bar chart with 5 vertical bars. Bar 1 is centered at 15.15, and length is from 1 to 1 with fill colour strong reddish orange which maps to am = auto with border colour strong reddish orange which maps to am = auto with border line type solid which maps to am = auto with border line width 2 which maps to am = auto. Bar 2 is centered at 17.67, and length is from 2 to 2 with fill colour strong reddish orange which maps to am = auto with border colour strong reddish orange which maps to am = auto with border line type solid which maps to am = auto with border line width 2 which maps to am = auto. Bar 3 is centered at 20.2, and length is from 2 to 4 with fill colour strong reddish orange which maps to am = auto with border colour strong reddish orange which maps to am = auto with border line type solid which maps to am = auto with border line width 2 which maps to am = auto. Bar 4 is centered at 22.72, and length is from 1 to 2 with fill colour strong reddish orange which maps to am = auto with border colour strong reddish orange which maps to am = auto with border line type solid which maps to am = auto with border line width 2 which maps to am = auto. Bar 5 is centered at 25.25, and length is from 1 to 1 with fill colour strong reddish orange which maps to am = auto with border colour strong reddish orange which maps to am = auto with border line type solid which maps to am = auto with border line width 2 which maps to am = auto. Bar 6 is centered at 15.15, and length is from 0 to 1 with fill colour brilliant bluish green which maps to am = manual with border colour brilliant bluish green which maps to am = manual with border line type 22 which maps to am = manual with border line width 6 which maps to am = manual. Bar 7 is centered at 17.67, and length is from 0 to 2 with fill colour brilliant bluish green which maps to am = manual with border colour brilliant bluish green which maps to am = manual with border line type 22 which maps to am = manual with border line width 6 which maps to am = manual. Bar 8 is centered at 20.2, and length is from 0 to 2 with fill colour brilliant bluish green which maps to am = manual with border colour brilliant bluish green which maps to am = manual with border line type 22 which maps to am = manual with border line width 6 which maps to am = manual. Bar 9 is centered at 22.72, and length is from 0 to 1 with fill colour brilliant bluish green which maps to am = manual with border colour brilliant bluish green which maps to am = manual with border line type 22 which maps to am = manual with border line width 6 which maps to am = manual. Bar 10 is centered at 25.25, and length is from 0 to 1 with fill colour brilliant bluish green which maps to am = manual with border colour brilliant bluish green which maps to am = manual with border line type 22 which maps to am = manual with border line width 6 which maps to am = manual. These are stacked, as sorted by am,am,am,am,am. Warning messages: 1: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. ℹ Please use `linewidth` instead. 2: Using alpha for a discrete variable is not advised. 3: Using size for a discrete variable is not advised. > ### Boxplots > VI(qplot(data=m, cyl, mpg, geom="boxplot", alpha=am, colour=am, fill=am, linetype=am, size=am)) This is an untitled chart with no subtitle or caption. It has x-axis 'cyl' with labels 4, 6 and 8. It has y-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. There is a legend indicating alpha is used to show am, with 2 levels: auto shown as 0.1 alpha and manual shown as 1 alpha. There is a legend indicating colour is used to show am, with 2 levels: auto shown as strong reddish orange colour and manual shown as brilliant bluish green colour. There is a legend indicating fill is used to show am, with 2 levels: auto shown as strong reddish orange fill and manual shown as brilliant bluish green fill. There is a legend indicating linetype is used to show am, with 2 levels: auto shown as solid linetype and manual shown as 22 linetype. There is a legend indicating size is used to show am, with 2 levels: auto shown as 2 size and manual shown as 6 size. The chart is a boxplot comprised of 6 vertical boxes with whiskers. There is a box at x=0.81 with alpha 0.1 which maps to am = auto with colour strong reddish orange which maps to am = auto with fill strong reddish orange which maps to am = auto with line size 2 mm which maps to am = auto with line type solid which maps to am = auto. It has median 28.85. The box goes from 25.2 to 30.9, and the whiskers extend to 21.4 and 33.9. There are 0 outliers for this boxplot. There is a box at x=1.19 with alpha 1 which maps to am = manual with colour brilliant bluish green which maps to am = manual with fill brilliant bluish green which maps to am = manual with line size 6 mm which maps to am = manual with line type 22 which maps to am = manual. It has median 22.8. The box goes from 22.15 to 23.6, and the whiskers extend to 21.5 and 24.4. There are 0 outliers for this boxplot. There is a box at x=1.81 with alpha 0.1 which maps to am = auto with colour strong reddish orange which maps to am = auto with fill strong reddish orange which maps to am = auto with line size 2 mm which maps to am = auto with line type solid which maps to am = auto. It has median 21. The box goes from 20.35 to 21, and the whiskers extend to 19.7 and 21. There are 0 outliers for this boxplot. There is a box at x=2.19 with alpha 1 which maps to am = manual with colour brilliant bluish green which maps to am = manual with fill brilliant bluish green which maps to am = manual with line size 6 mm which maps to am = manual with line type 22 which maps to am = manual. It has median 18.65. The box goes from 18.03 to 19.75, and the whiskers extend to 17.8 and 21.4. There are 0 outliers for this boxplot. There is a box at x=2.81 with alpha 0.1 which maps to am = auto with colour strong reddish orange which maps to am = auto with fill strong reddish orange which maps to am = auto with line size 2 mm which maps to am = auto with line type solid which maps to am = auto. It has median 15.4. The box goes from 15.2 to 15.6, and the whiskers extend to 15 and 15.8. There are 0 outliers for this boxplot. There is a box at x=3.19 with alpha 1 which maps to am = manual with colour brilliant bluish green which maps to am = manual with fill brilliant bluish green which maps to am = manual with line size 6 mm which maps to am = manual with line type 22 which maps to am = manual. It has median 15.2. The box goes from 14.05 to 16.62, and the whiskers extend to 10.4 and 19.2. There are 0 outliers for this boxplot. Warning messages: 1: Using alpha for a discrete variable is not advised. 2: Using size for a discrete variable is not advised. > ### Hline > VI(qplot(data=m[1:10,], geom="hline", mapping=aes(yintercept=mpg, alpha=am, colour=am, + linetype=am, size=am))) This is an untitled chart with no subtitle or caption. It has x-axis '' with labels . It has y-axis '' with labels 15.0, 17.5, 20.0 and 22.5. There is a legend indicating alpha is used to show am, with 2 levels: auto shown as 0.1 alpha and manual shown as 1 alpha. There is a legend indicating colour is used to show am, with 2 levels: auto shown as strong reddish orange colour and manual shown as brilliant bluish green colour. There is a legend indicating linetype is used to show am, with 2 levels: auto shown as solid linetype and manual shown as 22 linetype. There is a legend indicating size is used to show am, with 2 levels: auto shown as 2 size and manual shown as 6 size. The chart is 10 horizontal lines as follows: Line at y position 21 with size 2 which maps to am = auto, with line type solid which maps to am = auto, with colour strong reddish orange which maps to am = auto, Line at y position 21 with size 2 which maps to am = auto, with line type solid which maps to am = auto, with colour strong reddish orange which maps to am = auto, Line at y position 22.8 with size 2 which maps to am = auto, with line type solid which maps to am = auto, with colour strong reddish orange which maps to am = auto, Line at y position 21.4 with size 6 which maps to am = manual, with line type 22 which maps to am = manual, with colour brilliant bluish green which maps to am = manual, Line at y position 18.7 with size 6 which maps to am = manual, with line type 22 which maps to am = manual, with colour brilliant bluish green which maps to am = manual, Line at y position 18.1 with size 6 which maps to am = manual, with line type 22 which maps to am = manual, with colour brilliant bluish green which maps to am = manual, Line at y position 14.3 with size 6 which maps to am = manual, with line type 22 which maps to am = manual, with colour brilliant bluish green which maps to am = manual, Line at y position 24.4 with size 6 which maps to am = manual, with line type 22 which maps to am = manual, with colour brilliant bluish green which maps to am = manual, Line at y position 22.8 with size 6 which maps to am = manual, with line type 22 which maps to am = manual, with colour brilliant bluish green which maps to am = manual and Line at y position 19.2 with size 6 which maps to am = manual, with line type 22 which maps to am = manual, with colour brilliant bluish green which maps to am = manual. Warning messages: 1: Using alpha for a discrete variable is not advised. 2: Using size for a discrete variable is not advised. > ### Line > VI(qplot(data=m[1:10,], geom="line", disp, mpg, alpha=am, colour=am, linetype=am, size=am)) This is an untitled chart with no subtitle or caption. It has x-axis 'disp' with labels 100, 200 and 300. It has y-axis 'mpg' with labels 15.0, 17.5, 20.0 and 22.5. There is a legend indicating alpha is used to show am, with 2 levels: auto shown as 0.1 alpha and manual shown as 1 alpha. There is a legend indicating colour is used to show am, with 2 levels: auto shown as strong reddish orange colour and manual shown as brilliant bluish green colour. There is a legend indicating linetype is used to show am, with 2 levels: auto shown as solid linetype and manual shown as 22 linetype. There is a legend indicating size is used to show am, with 2 levels: auto shown as 2 size and manual shown as 6 size. The chart is a set of 2 lines. Line 1 connects 3 points, at (108, 22.8), (160, 21) and (160, 21). This line has alpha 0.1 which maps to am = auto. This line has colour strong reddish orange which maps to am = auto. This line has line size 2 mm which maps to am = auto. This line has line type solid which maps to am = auto. Line 2 connects 7 points, at (140.8, 22.8), (146.7, 24.4), (167.6, 19.2), (225, 18.1), (258, 21.4), (360, 18.7) and (360, 14.3). This line has alpha 1 which maps to am = manual. This line has colour brilliant bluish green which maps to am = manual. This line has line size 6 mm which maps to am = manual. This line has line type 22 which maps to am = manual. Warning messages: 1: Using alpha for a discrete variable is not advised. 2: Using size for a discrete variable is not advised. > > # Test all graph types when number of items exceeds threshold, so no detail printed > VI(qplot(data=m, mpg, disp, geom="point")) This is an untitled chart with no subtitle or caption. It has x-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. It has y-axis 'disp' with labels 100, 200, 300 and 400. The chart is a set of 32 big solid circle points of which about 97% can be seen. > VI(qplot(data=m, mpg, disp, geom="line")) This is an untitled chart with no subtitle or caption. It has x-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. It has y-axis 'disp' with labels 100, 200, 300 and 400. The chart is a set of 1 line. Line 1 connects 32 points. > VI(qplot(data=m, as.factor(mpg), disp, geom="boxplot")) This is an untitled chart with no subtitle or caption. It has x-axis 'as.factor(mpg)' with labels 10.4, 13.3, 14.3, 14.7, 15, 15.2, 15.5, 15.8, 16.4, 17.3, 17.8, 18.1, 18.7, 19.2, 19.7, 21, 21.4, 21.5, 22.8, 24.4, 26, 27.3, 30.4, 32.4 and 33.9. It has y-axis 'disp' with labels 100, 200, 300 and 400. The chart is a boxplot comprised of 25 vertical boxes with whiskers. > VI(qplot(data=m, mpg, geom="histogram")) This is an untitled chart with no subtitle or caption. It has x-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. It has y-axis '' with labels 0, 1, 2, 3, 4 and 5. The chart is a bar chart with 30 vertical bars. > VI(qplot(data=m, mapping=aes(yintercept=mpg), geom="hline")) This is an untitled chart with no subtitle or caption. It has x-axis '' with labels . It has y-axis '' with labels 10, 15, 20, 25, 30 and 35. The chart is 32 horizontal lines. > VI(qplot(data=m, mpg, disp, geom="smooth")) This is an untitled chart with no subtitle or caption. It has x-axis 'mpg' with labels 10, 15, 20, 25, 30 and 35. It has y-axis 'disp' with labels 0, 200 and 400. The chart is a 'lowess' smoothed curve with 95% confidence intervals covering 17% of the graph. > > # Test cases for different methods of providing data > x = 1:10 > y = c(2,5,1,4,3,5,1,3,2,4) > z = as.factor(rep(c("yes","no"),5)) > df = data.frame(x,y,z) > # data frame provided to data param > VI(qplot(data=df, x=x, y=y, facets=.~z)) This is an untitled chart with no subtitle or caption. The chart is comprised of 2 panels containing sub-charts, arranged horizontally. The panels represent different values of z. Each sub-chart has x-axis 'x' with labels 2.5, 5.0, 7.5 and 10.0. Each sub-chart has y-axis 'y' with labels 1, 2, 3, 4 and 5. Panel 1 represents data for z = no. Panel 1 is a set of 5 big solid circle points of which about 100% can be seen. The points are at: (2, 5), (4, 4), (6, 5), (8, 3) and (10, 4) Panel 2 represents data for z = yes. Panel 2 is a set of 5 big solid circle points of which about 100% can be seen. The points are at: (1, 2), (3, 1), (5, 3), (7, 1) and (9, 2) > # data frame provided to data param, function eval > VI(qplot(data=df, x=x*2, y=10-y, facets=.~z)) This is an untitled chart with no subtitle or caption. The chart is comprised of 2 panels containing sub-charts, arranged horizontally. The panels represent different values of z. Each sub-chart has x-axis 'x * 2' with labels 5, 10, 15 and 20. Each sub-chart has y-axis '10 - y' with labels 5, 6, 7, 8 and 9. Panel 1 represents data for z = no. Panel 1 is a set of 5 big solid circle points of which about 100% can be seen. The points are at: (4, 5), (8, 6), (12, 5), (16, 7) and (20, 6) Panel 2 represents data for z = yes. Panel 2 is a set of 5 big solid circle points of which about 100% can be seen. The points are at: (2, 8), (6, 9), (10, 7), (14, 9) and (18, 8) > # No data param, data frame accessed directly > # Doesn't seem to be possible to facet this way > VI(qplot(x=df$x, y=df$y)) This is an untitled chart with no subtitle or caption. It has x-axis 'df$x' with labels 2.5, 5.0, 7.5 and 10.0. It has y-axis 'df$y' with labels 1, 2, 3, 4 and 5. The chart is a set of 10 big solid circle points of which about 100% can be seen. The points are at: (1, 2), (2, 5), (3, 1), (4, 4), (5, 3), (6, 5), (7, 1), (8, 3), (9, 2) and (10, 4) > # No data param, data frame accessed directly, function eval > VI(qplot(x=df$x*2, y=10-df$y)) This is an untitled chart with no subtitle or caption. It has x-axis 'df$x * 2' with labels 5, 10, 15 and 20. It has y-axis '10 - df$y' with labels 5, 6, 7, 8 and 9. The chart is a set of 10 big solid circle points of which about 100% can be seen. The points are at: (2, 8), (4, 5), (6, 9), (8, 6), (10, 7), (12, 5), (14, 9), (16, 7), (18, 8) and (20, 6) > # Separate vectors accessed directly > VI(qplot(x=x, y=y)) This is an untitled chart with no subtitle or caption. It has x-axis 'x' with labels 2.5, 5.0, 7.5 and 10.0. It has y-axis 'y' with labels 1, 2, 3, 4 and 5. The chart is a set of 10 big solid circle points of which about 100% can be seen. The points are at: (1, 2), (2, 5), (3, 1), (4, 4), (5, 3), (6, 5), (7, 1), (8, 3), (9, 2) and (10, 4) > # Separate vectors accessed directly, function eval > VI(qplot(x=x*2, y=10-y)) This is an untitled chart with no subtitle or caption. It has x-axis 'x * 2' with labels 5, 10, 15 and 20. It has y-axis '10 - y' with labels 5, 6, 7, 8 and 9. The chart is a set of 10 big solid circle points of which about 100% can be seen. The points are at: (2, 8), (4, 5), (6, 9), (8, 6), (10, 7), (12, 5), (14, 9), (16, 7), (18, 8) and (20, 6) > # Constants > VI(qplot(1:10,c(2,5,1,4,3,5,1,3,2,4))) This is an untitled chart with no subtitle or caption. It has x-axis '1:10' with labels 2.5, 5.0, 7.5 and 10.0. It has y-axis 'c(2, 5, 1, 4, 3, 5, 1, 3, 2, 4)' with labels 1, 2, 3, 4 and 5. The chart is a set of 10 big solid circle points of which about 100% can be seen. The points are at: (1, 2), (2, 5), (3, 1), (4, 4), (5, 3), (6, 5), (7, 1), (8, 3), (9, 2) and (10, 4) > > proc.time() user system elapsed 5.48 0.39 5.87