Karl Ropkins
2023-Dec-16 12:21 UTC
[R] Advice on starting to analyze smokestack emissions?
Kevin, Sorry, was not aware of any access-restriction, but if you have problems and were interested in local AQ maybe https://www.epa.gov/outdoor-air-quality-data Karl ------------------------------------------------------------------ [EXTERNAL] Message: 3 Date: Fri, 15 Dec 2023 13:29:36 +0000 From: Kevin Zembower <kevin at zembower.org> To: R-help email list <r-help at r-project.org> Subject: Re: [R] Advice on starting to analyze smokestack emissions? Message-ID: <0100018c6dab10c0-a6da3643-a9f2-44af-8a69-9303ea534749-000000 at email.amazonses.com> Content-Type: text/plain; charset="utf-8" Bert, Tim, Karl and Richard, thank you all for your suggestions and help. I will try the R-sig-ecology list. Karl, I wasn't aware of the RAQSAPI package, but it looked promising. However, when I went to the source of the data it uses, the United States Environmental Protection Agency?s (US EPA) Air Quality System (AQS) Data Mart database, it looks like interactive access to the data is restricted to those who can document a professional agency affiliation. I don't have that. I'll work with the package to see if this is true regarding obtaining the data through it. Thanks for the suggestion. Richard, the Canada study of crematoriums was very useful. Thanks. Thanks, again, all, for your help. -Kevin You might also try the R-Sig-ecology list, though I would agree that it's not clearly related. Still, air pollution effects...? -- Bert On Tue, Dec 12, 2023 at 3:15?AM Kevin Zembower via R-help < r-help at r-project.org> wrote:> Hello, all, > > [Originally sent to r-sig-geo list, with no response. Cross-posting > here, in the hope of a wider audience. Anyone with any experience in > this topic? Thanks.] > > I'm trying to get started analyzing the concentrations of smokestack > emissions. I don't have any professional background or training for > this; I'm just an old, retired guy who thinks playing with numbers is > fun. > > A local funeral home in my neighborhood (less than 1200 ft from my > home) is proposing to construct a crematorium for human remains. I > have some experience with the tidycensus package and thought it might > be interesting to construct a model for the changes in concentrations > of the pollutants from the smokestack and, using recorded wind speeds > and directions, see which US Census blocks would be affected. > > I have the US Government EPA SCREEN3 output on how concentration > varies with distance from the smokestack. > See > https://www/. > epa.gov%2Fscram%2Fair-quality-dispersion-modeling-screening-models%23s > creen3&data=05%7C02%7Ctebert%40ufl.edu%7C3097c182143c47a6789c08dbfb2a7 > ed2%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638379932467260671%7C > Unknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h > aWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=QgsYQ9w28caBmEGwJ9Kei2x0fSkH3 > 4v3%2BfAo37GdcYQ%3D&reserved=0 if curious. As a first task, I'd like > to see if I can calculate similar results in R. I'm aware of the > 'plume' steady-state Gaussian dispersion package > (https://rdr/ > r.io%2Fgithub%2Fholstius%2Fplume%2Ff%2Finst%2Fdoc%2Fplume-intro.pdf&data=05%7C02%7Ctebert%40ufl.edu%7C3097c182143c47a6789c08dbfb2a7ed2%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638379932467260671%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DN9oxiJnDFvvmY968G9t9Sagr8UfJ2ySZiGWV1%2F9AC8%3D&reserved=0), but am a little concerned that this package was last updated 11 years ago. > > Do you have any recommendations for me on how to get started analyzing > this problem? Is 'plume' still the way to go? I'm aware that there are > many atmospheric dispersion models from the US EPA, but I was hoping > to keep my work within R, which I'm really enjoying using and learning > about. Are SCREEN3 and 'plume' comparable? Is this the best R list to > ask questions about this topic? > > Thanks for any advice or guidance you have for me. > > -Kevin > > > > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat/ > .ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C02%7Ctebert%40ufl.edu > %7C3097c182143c47a6789c08dbfb2a7ed2%7C0d4da0f84a314d76ace60a62331e1b84 > %7C0%7C0%7C638379932467260671%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw > MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda > ta=dxsuLWVRx8wNnu49SJ34AAh7oRECvDIrQh9%2Bpx48SL0%3D&reserved=0 > PLEASE do read the posting guide > http://www.r/ > -project.org%2Fposting-guide.html&data=05%7C02%7Ctebert%40ufl.edu%7C30 > 97c182143c47a6789c08dbfb2a7ed2%7C0d4da0f84a314d76ace60a62331e1b84%7C0% > 7C0%7C638379932467260671%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL > CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=QY > AiKA8xDhcPyQmRZ6Vqcr5mdszE8WSRyFmCqzQ7Rog%3D&reserved=0 > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ------------------------------ Message: 8 Date: Wed, 13 Dec 2023 17:38:43 +1300 From: "Richard O'Keefe" <raoknz at gmail.com> To: Bert Gunter <bgunter.4567 at gmail.com> Cc: Kevin Zembower <kevin at zembower.org>, R-help email list <r-help at r-project.org> Subject: Re: [R] Advice on starting to analyze smokestack emissions? Message-ID: <CABcYAdLBgCy2b-QTOaedQ6dAo-LfuCHsDS6LgufbE1S0SByP3A at mail.gmail.com> Content-Type: text/plain; charset="utf-8" This https://ncceh.ca/resources/evidence-reviews/crematoria-emissions-and-air-quality-impacts might provide some useful information. On Wed, 13 Dec 2023 at 04:53, Bert Gunter <bgunter.4567 at gmail.com> wrote:> > You might also try the R-Sig-ecology list, though I would agree that it's > not clearly related. Still, air pollution effects...? > > -- Bert > > On Tue, Dec 12, 2023 at 3:15?AM Kevin Zembower via R-help < > r-help at r-project.org> wrote: > > > Hello, all, > > > > [Originally sent to r-sig-geo list, with no response. Cross-posting > > here, in the hope of a wider audience. Anyone with any experience in > > this topic? Thanks.] > > > > I'm trying to get started analyzing the concentrations of smokestack > > emissions. I don't have any professional background or training for > > this; I'm just an old, retired guy who thinks playing with numbers is > > fun. > > > > A local funeral home in my neighborhood (less than 1200 ft from my > > home) is proposing to construct a crematorium for human remains. I have > > some experience with the tidycensus package and thought it might be > > interesting to construct a model for the changes in concentrations of > > the pollutants from the smokestack and, using recorded wind speeds and > > directions, see which US Census blocks would be affected. > > > > I have the US Government EPA SCREEN3 output on how concentration varies > > with distance from the smokestack. > > See > > https://www.epa.gov/scram/air-quality-dispersion-modeling-screening-models#screen3 > > if curious. As a first task, I'd like to see if I can calculate similar > > results in R. I'm aware of the 'plume' steady-state Gaussian dispersion > > package > > (https://rdrr.io/github/holstius/plume/f/inst/doc/plume-intro.pdf), but > > am a little concerned that this package was last updated 11 years ago. > > > > Do you have any recommendations for me on how to get started analyzing > > this problem? Is 'plume' still the way to go? I'm aware that there are > > many atmospheric dispersion models from the US EPA, but I was hoping to > > keep my work within R, which I'm really enjoying using and learning > > about. Are SCREEN3 and 'plume' comparable? Is this the best R list to > > ask questions about this topic? > > > > Thanks for any advice or guidance you have for me. > > > > -Kevin > > > > > > > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.r-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.r-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.------------------------------ Message: 9 Date: Tue, 12 Dec 2023 20:38:54 -0800 From: Bert Gunter <bgunter.4567 at gmail.com> To: "Ebert,Timothy Aaron" <tebert at ufl.edu> Cc: Kevin Zembower <kevin at zembower.org>, R-help email list <r-help at r-project.org> Subject: Re: [R] Advice on starting to analyze smokestack emissions? Message-ID: <CAGxFJbRZ6L8XWGWOm404j2R2GvHtdy+TEPgTrTrW_ngPFvMS=Q at mail.gmail.com> Content-Type: text/plain; charset="utf-8" My point was only that there might be functionality there that might be relevant to his concerns. .. with help on how to use it. Bert On Tue, Dec 12, 2023, 19:37 Ebert,Timothy Aaron <tebert at ufl.edu> wrote:> That depends on how exactly everything must match your primary question. > The ecology group might be helpful for how biodiversity changes with > proximity to a smokestack. They might have a better idea if the smokestack > was from a coal fired powerplant or oil refinery. The modeling process > would be similar, though the abundance of individual contaminants would be > quite different. Just my thought for what it is worth. > Tim > > -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of Bert Gunter > Sent: Tuesday, December 12, 2023 10:53 AM > To: Kevin Zembower <kevin at zembower.org> > Cc: R-help email list <r-help at r-project.org> > Subject: Re: [R] Advice on starting to analyze smokestack emissions? > > [External Email] > > You might also try the R-Sig-ecology list, though I would agree that it's > not clearly related. Still, air pollution effects...? > > -- Bert > > On Tue, Dec 12, 2023 at 3:15?AM Kevin Zembower via R-help < > r-help at r-project.org> wrote: > > > Hello, all, > > > > [Originally sent to r-sig-geo list, with no response. Cross-posting > > here, in the hope of a wider audience. Anyone with any experience in > > this topic? Thanks.] > > > > I'm trying to get started analyzing the concentrations of smokestack > > emissions. I don't have any professional background or training for > > this; I'm just an old, retired guy who thinks playing with numbers is > > fun. > > > > A local funeral home in my neighborhood (less than 1200 ft from my > > home) is proposing to construct a crematorium for human remains. I > > have some experience with the tidycensus package and thought it might > > be interesting to construct a model for the changes in concentrations > > of the pollutants from the smokestack and, using recorded wind speeds > > and directions, see which US Census blocks would be affected. > > > > I have the US Government EPA SCREEN3 output on how concentration > > varies with distance from the smokestack. > > See > > https://www/. > > epa.gov%2Fscram%2Fair-quality-dispersion-modeling-screening-models%23s > > creen3&data=05%7C02%7Ctebert%40ufl.edu%7C3097c182143c47a6789c08dbfb2a7 > > ed2%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638379932467260671%7C > > Unknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h > > aWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=QgsYQ9w28caBmEGwJ9Kei2x0fSkH3 > > 4v3%2BfAo37GdcYQ%3D&reserved=0 if curious. As a first task, I'd like > > to see if I can calculate similar results in R. I'm aware of the > > 'plume' steady-state Gaussian dispersion package > > (https://rdr/ > > r.io > %2Fgithub%2Fholstius%2Fplume%2Ff%2Finst%2Fdoc%2Fplume-intro.pdf&data=05%7C02%7Ctebert% > 40ufl.edu%7C3097c182143c47a6789c08dbfb2a7ed2%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638379932467260671%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DN9oxiJnDFvvmY968G9t9Sagr8UfJ2ySZiGWV1%2F9AC8%3D&reserved=0), > but am a little concerned that this package was last updated 11 years ago. > > > > Do you have any recommendations for me on how to get started analyzing > > this problem? Is 'plume' still the way to go? I'm aware that there are > > many atmospheric dispersion models from the US EPA, but I was hoping > > to keep my work within R, which I'm really enjoying using and learning > > about. Are SCREEN3 and 'plume' comparable? Is this the best R list to > > ask questions about this topic? > > > > Thanks for any advice or guidance you have for me. > > > > -Kevin > > > > > > > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat/ > > .ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C02%7Ctebert%40ufl.edu > > %7C3097c182143c47a6789c08dbfb2a7ed2%7C0d4da0f84a314d76ace60a62331e1b84 > > %7C0%7C0%7C638379932467260671%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw > > MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda > > ta=dxsuLWVRx8wNnu49SJ34AAh7oRECvDIrQh9%2Bpx48SL0%3D&reserved=0 > > PLEASE do read the posting guide > > http://www.r/ > > -project.org%2Fposting-guide.html&data=05%7C02%7Ctebert%40ufl.edu%7C30 > > 97c182143c47a6789c08dbfb2a7ed2%7C0d4da0f84a314d76ace60a62331e1b84%7C0% > > 7C0%7C638379932467260671%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL > > CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=QY > > AiKA8xDhcPyQmRZ6Vqcr5mdszE8WSRyFmCqzQ7Rog%3D&reserved=0 > > and provide commented, minimal, self-contained, reproducible code. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.r-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]] ------------------------------ Message: 10 Date: Wed, 13 Dec 2023 06:28:26 +0000 From: Rui Barradas <ruipbarradas at sapo.pt> To: Robert Baer <rbaer at atsu.edu>, varin sacha <varinsacha at yahoo.fr>, "r-help at r-project.org" <r-help at r-project.org>, Ben Bolker <bbolker at gmail.com> Subject: Re: [R] ggplot2: Get the regression line with 95% confidence bands Message-ID: <42a94897-80e8-4a89-918d-769b1b2eeadd at sapo.pt> Content-Type: text/plain; charset="utf-8"; Format="flowed" ?s 00:36 de 13/12/2023, Robert Baer escreveu:> coord_cartesian also seems to work for y, and including the breaks = . > How about: > > df=data.frame(year= c(2012,2015,2018,2022), > score=c(495,493, 495, 474)) > > ggplot(df, aes(x = year, y = score)) + > geom_point() + > geom_smooth(method = "lm", formula = y ~ x) + > labs(title = "Standard linear regression for France", x = "Year", y > "PISA score in mathematics") + > coord_cartesian(ylim=c(470,500)) + > scale_x_continuous(breaks = 2012:2022) > > On 12/12/2023 3:19 PM, varin sacha via R-help wrote: >> Dear Ben, >> Dear Daniel, >> Dear Rui, >> Dear Bert, >> >> Here below my R code. >> I really appreciate all your comments. My R code is perfectly working >> but there is still something I would like to improve. The X-axis is >> showing 2012.5 ; 2015.0 ; 2017.5 ; 2020.0 >> I would like to see on X-axis only the year (2012 ; 2015 ; 2017 ; >> 2020). How to do? >> >> >> ######### >> library(ggplot2) >> df=data.frame(year= c(2012,2015,2018,2022), score=c(495,493, 495, 474)) >> >> ggplot(df, aes(x = year, y = score)) + geom_point() + >> geom_smooth(method = "lm", formula = y ~ x) + >> labs(title = "Standard linear regression for France", x = "Year", y >> = "PISA score in mathematics") + >> scale_y_continuous(limits=c(470,500),oob=scales::squish) >> ######### >> >> >> >> >> >> >> >> >> >> Le lundi 11 d?cembre 2023 ? 23:38:06 UTC+1, Ben Bolker >> <bbolker at gmail.com> a ?crit : >> >> >> >> >> >> >> >> On 2023-12-11 5:27 p.m., Daniel Nordlund wrote: >>> On 12/10/2023 2:50 PM, Rui Barradas wrote: >>>> ?s 22:35 de 10/12/2023, varin sacha via R-help escreveu: >>>>> Dear R-experts, >>>>> >>>>> Here below my R code, as my X-axis is "year", I must be missing one >>>>> or more steps! I am trying to get the regression line with the 95% >>>>> confidence bands around the regression line. Any help would be >>>>> appreciated. >>>>> >>>>> Best, >>>>> S. >>>>> >>>>> >>>>> ############################################# >>>>> library(ggplot2) >>>>> df=data.frame(year=factor(c("2012","2015","2018","2022")), >>>>> score=c(495,493, 495, 474)) >>>>> ggplot(df, aes(x=year, y=score)) + geom_point( ) + >>>>> geom_smooth(method="lm", formula = score ~ factor(year), data = df) + >>>>> labs(title="Standard linear regression for France", y="PISA score in >>>>> mathematics") + ylim(470, 500) >>>>> ############################################# >>>>> >>>>> ______________________________________________ >>>>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>>> https://stat.ethz.ch/mailman/listinfo/r-help >>>>> PLEASE do read the posting guide >>>>> http://www.r-project.org/posting-guide.html >>>>> and provide commented, minimal, self-contained, reproducible code. >>>> Hello, >>>> >>>> I don't see a reason why year should be a factor and the formula in >>>> geom_smooth is wrong, it should be y ~ x, the aesthetics envolved. >>>> It still doesn't plot the CI's though. There's a warning and I am not >>>> understanding where it comes from. But the regression line is plotted. >>>> >>>> >>>> >>>> ggplot(df, aes(x = as.numeric(year), y = score)) + >>>> geom_point() + >>>> geom_smooth(method = "lm", formula = y ~ x) + >>>> labs( >>>> title = "Standard linear regression for France", >>>> x = "Year", >>>> y = "PISA score in mathematics" >>>> ) + >>>> ylim(470, 500) >>>> #> Warning message: >>>> #> In max(ids, na.rm = TRUE) : no non-missing arguments to max; >>>> returning -Inf >>>> >>>> >>>> >>>> Hope this helps, >>>> >>>> Rui Barradas >>>> >>>> >>>> >>> After playing with this for a little while, I realized that the problem >>> with plotting the confidence limits is the addition of ylim(470, 500). >>> The confidence values are outside the ylim values. Remove the limits, >>> or increase the range, and the confidence curves will plot. >>> >>> Hope this is helpful, >>> >>> Dan >>> >> Or use + scale_y_continuous(limits = c(470, 500), oob >> scales::squish) >> >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.r-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.r-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.r-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.Hello, In the code below I don't use coord_cartesian because to set ylim will cut part of the confidence intervals. To have labels only in the years present in the data set, get them from the data. library(ggplot2) df <- data.frame(year= c(2012,2015,2018,2022), score=c(495,493, 495, 474)) # in this case unique is not needed, it's here # because it might with some data sets brks_year <- df$year # |> unique() ggplot(df, aes(x = year, y = score)) + geom_point() + geom_smooth(method = "lm", formula = y ~ x) + labs(title = "Standard linear regression for France", x = "Year", y = "PISA score in mathematics") + scale_x_continuous(breaks = brks_year) Hope this helps, Rui Barradas -- Este e-mail foi analisado pelo software antiv?rus AVG para verificar a presen?a de v?rus. http://www.avg.com/ ------------------------------ Message: 11 Date: Wed, 13 Dec 2023 00:09:06 -0500 From: "Nan Xiao" <me at nanx.me> To: r-packages at r-project.org Subject: [R] [R-pkgs] simtrial: Clinical Trial Simulation Message-ID: <79834370-a2ad-4a6a-8b55-19b29e998f8a at app.fastmail.com> Content-Type: text/plain; charset="us-ascii" Dear all, I am happy to announce that {simtrial} is now on CRAN (https://cran.r-project.org/package=simtrial). simtrial is a fast and extensible clinical trial simulation framework for time-to-event endpoints. This release brings a new tabular data processing engine powered by data.table for 3x to 5x faster simulations, a new parallelization adaptor with %dofuture%, a refreshed API that aligns with the gsDesign2 style guide, and new functions for zero early weight and analysis date. For a summary of the updates, please see the announcement: https://keaven.github.io/blog/simtrial-0-3-2/. I hope you find simtrial helpful. Please feel free to reach out with feedback or questions. Best regards, -Nan _______________________________________________ R-packages mailing list R-packages at r-project.org https://stat.ethz.ch/mailman/listinfo/r-packages ------------------------------ Subject: Digest Footer _______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ------------------------------ End of R-help Digest, Vol 250, Issue 13 *************************************** ------------------------------ Subject: Digest Footer _______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.r-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ------------------------------ End of R-help Digest, Vol 250, Issue 16 ***************************************