Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-08 Thread Bert Gunter
... and see also Section 3.5, Scope of Variables in the "R Language Definition" manual that ships with R. Cheers, Bert On Wed, Nov 8, 2023 at 8:06 AM Deepayan Sarkar wrote: > On Wed, 8 Nov 2023 at 10:56, Christopher W. Ryan via R-help > wrote: > > > > Very helpful, Deepayan, and educational.

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-08 Thread Deepayan Sarkar
On Wed, 8 Nov 2023 at 10:56, Christopher W. Ryan via R-help wrote: > > Very helpful, Deepayan, and educational. Thank you. > > What does NSE stand for? Non-standard evaluation, used widely in formula-interface functions as well as the tidyverse. with() in my example is a less nuanced version of

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-08 Thread Ben Bolker
Non-standard evaluation On 2023-11-08 10:56 a.m., Christopher W. Ryan via R-help wrote: Very helpful, Deepayan, and educational. Thank you. What does NSE stand for? Thanks, Chris Deepayan Sarkar wrote: --Chris Ryan __ R-help@r-project.org

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-08 Thread Christopher W. Ryan via R-help
Very helpful, Deepayan, and educational. Thank you. What does NSE stand for? Thanks, Chris Deepayan Sarkar wrote: > > --Chris Ryan __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-07 Thread Deepayan Sarkar
Handling NSE in these kinds of examples is a pain in lattice. I would suggest using with() and dropping the data argument for simple examples, e.g., dd |> mutate(new.proportion = las/total, new.bubble = total/100) |> with(dotplot(agency ~ new.proportion, pch = 16, cex = new.bubble)) But if

[R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-07 Thread Christopher Ryan via R-help
Hello. My question is in the subject line. Using R 4.1.3 on Windows 10. Commented MWE below. Thanks. --Chris Ryan library(dplyr) library(lattice) ## fabricate a dataframe dd <- data.frame(agency = sample(LETTERS, size = 5), total = sample(100:200, size = 5), las = sample(20:40, size = 5)) dd