Skip to content

Changed the use of opts() to theme(), since opts() was deprecated in R v0.9.1 and will no longer work in R v3.1.0.#127

Closed
earlruby wants to merge 1 commit intobasho:masterfrom
earlruby:r-opt-to-theme
Closed

Changed the use of opts() to theme(), since opts() was deprecated in R v0.9.1 and will no longer work in R v3.1.0.#127
earlruby wants to merge 1 commit intobasho:masterfrom
earlruby:r-opt-to-theme

Conversation

@earlruby
Copy link
Copy Markdown

@earlruby earlruby commented Jun 6, 2014

Changed the use of opts() to theme(), since opts() was deprecated in R v0.9.1 and will no longer work in R v3.1.0.

v0.9.1 and will no longer work in R v3.1.0.
@slfritchie
Copy link
Copy Markdown
Contributor

Hi, thanks for the patch. I've a question for R 2.11.1 users like myself who aren't frequent R users: can this patch be modified to support older versions of R also?

% R --version
R version 2.11.1 (2010-05-31)
Copyright (C) 2010 The R Foundation for Statistical Computing
[....]

% make results
Rscript --vanilla priv/summary.r -i tests/current
[1] "plyr"
Loading required package: plyr
[1] "grid"
Loading required package: grid
[1] "getopt"
Loading required package: getopt
[1] "proto"
Loading required package: proto
[1] "ggplot2"
Loading required package: ggplot2
Loading required package: reshape

Attaching package: 'reshape'

The following object(s) are masked from 'package:plyr':

    round_any

[1] 0
[1] 23.0019
Error: could not find function "theme"
Execution halted
make: *** [results] Error 1

@benoitc
Copy link
Copy Markdown
Contributor

benoitc commented Jun 19, 2014

I did similar patch using the labs function:

diff --git a/priv/summary.r b/priv/summary.r
index 383223d..1ca1a5b 100755
--- a/priv/summary.r
+++ b/priv/summary.r
@@ -69,7 +69,7 @@ latency_plot <- ggplot(b$latencies, aes(x = elapsed)) +
                    labs(x = "Elapsed Secs", y = "Latency (ms)")

 # Plot median, mean and 95th percentiles
-plot2 <- latency_plot + opts(title = "Mean, Median, and 95th Percentile Latency") +
+plot2 <- latency_plot + labs(title = "Mean, Median, and 95th Percentile Latency") +
             geom_smooth(aes(y = median, color = "median"), size=0.5) +
             geom_point(aes(y = median, color = "median"), size=2.0) +

@@ -85,7 +85,7 @@ plot2 <- latency_plot + opts(title = "Mean, Median, and 95th Percentile Latency"
             #                 labels = c("95th", "Mean", "Median"))

 # Plot 99th percentile
-plot3 <- latency_plot + opts(title = "99th Percentile Latency") +
+plot3 <- latency_plot + labs(title = "99th Percentile Latency") +
             geom_smooth(aes(y = X99th, color = "99th"), size=0.5) +
             geom_point(aes(y = X99th, color = "99th"), size=2.0) +
             scale_colour_manual("Percentile", values = c("#FF665F", "#009D91"))
@@ -94,13 +94,13 @@ plot3 <- latency_plot + opts(title = "99th Percentile Latency") +
             #                 labels = c("99.9th", "99th"))

 # Plot 99.9th percentile
-plot4 <- latency_plot + opts(title = "99.9th Percentile Latency") +
+plot4 <- latency_plot + labs(title = "99.9th Percentile Latency") +
             geom_smooth(aes(y = X99_9th, color = "99.9th"), size=0.5) +
             geom_point(aes(y = X99_9th, color = "99.9th"), size=2.0) +
             scale_colour_manual("Percentile", values = c("#FF665F", "#009D91", "#FFA700"))

 # Plot 100th percentile
-plot5 <- latency_plot + opts(title = "Maximum Latency") +
+plot5 <- latency_plot + labs(title = "Maximum Latency") +
             geom_smooth(aes(y = max, color = "max"), size=0.5) +
             geom_point(aes(y = max, color = "max"), size=2.0) +
             scale_colour_manual("Percentile", values = c("#FF665F", "#009D91", "#FFA700"))

@slfritchie
Copy link
Copy Markdown
Contributor

@earlruby Hi, sorry I'm not terribly familiar with R. @benoitc's use of labs() appears to work for me with R 2.11.1. Does labs() also work correctly with R v3.1.0?

@ooshlablu
Copy link
Copy Markdown

@slfritchie I can confirm that labs() works with 3.1. I just ran a test in rtcloud, which installs the latest version of R from a PPA, and the current version being installed is:

ubuntu@bench101:~$ R --version
R version 3.1.0 (2014-04-10) -- "Spring Dance"

I think the right thing to do here is close this PR, and open a new one with the labs() changes. Let me know how you want to proceed.

@slfritchie
Copy link
Copy Markdown
Contributor

Closing in favor of labs(), thanks for bringing the R version change to our attention!

@slfritchie slfritchie closed this Jun 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants