[R] R-help Digest, Vol 250, Issue 13
Karl Ropkins
K@Ropk|n@ @end|ng |rom |eed@@@c@uk
Thu Dec 14 11:22:10 CET 2023
Kevin,
Maybe also look at what air quality monitoring is being done in area.
https://cran.r-project.org/web/packages/RAQSAPI/vignettes/RAQSAPIvignette.html
Depends what and how near, but might be something relevant there?
Karl
Dr Karl Ropkins
Transport Studies | Environment | University of Leeds
------------------------------
Message: 2
Date: Tue, 12 Dec 2023 07:52:59 -0800
From: Bert Gunter <bgunter.4567 using gmail.com>
To: Kevin Zembower <kevin using zembower.org>
Cc: R-help email list <r-help using r-project.org>
Subject: Re: [R] Advice on starting to analyze smokestack emissions?
Message-ID:
<CAGxFJbTox2EW5kaZ1Y3KS9=kvndjP-tWFzp8YThbuNLyQmARNg using mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
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 using 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 using 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: 3
Date: Tue, 12 Dec 2023 21:19:12 +0000 (UTC)
From: varin sacha <varinsacha using yahoo.fr>
To: "r-help using r-project.org" <r-help using r-project.org>, Ben Bolker
<bbolker using gmail.com>
Subject: Re: [R] ggplot2: Get the regression line with 95% confidence
bands
Message-ID: <68588390.888662.1702415952477 using mail.yahoo.com>
Content-Type: text/plain; charset="utf-8"
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 using 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 using 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 using 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: 4
Date: Tue, 12 Dec 2023 17:14:39 -0500
From: Ben Bolker <bbolker using gmail.com>
To: varin sacha <varinsacha using yahoo.fr>
Cc: R-Help <r-help using r-project.org>
Subject: Re: [R] ggplot2: Get the regression line with 95% confidence
bands
Message-ID:
<CABghstQELa+tyiLQYwivChiuen-YzyE3OGBo9gQUJ_hF7MDx+g using mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Use scale_x_continuous() and specify your desired breaks
On Tue, Dec 12, 2023, 4:19 PM varin sacha <varinsacha using yahoo.fr> 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 using 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 using 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 using 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: 5
Date: Tue, 12 Dec 2023 18:36:38 -0600
From: Robert Baer <rbaer using atsu.edu>
To: varin sacha <varinsacha using yahoo.fr>, "r-help using r-project.org"
<r-help using r-project.org>, Ben Bolker <bbolker using gmail.com>
Subject: Re: [R] ggplot2: Get the regression line with 95% confidence
bands
Message-ID: <352cddfd-6db4-4715-bad1-2f5690d8dc29 using atsu.edu>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
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 using 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 using 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 using 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 using 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: 6
Date: Wed, 13 Dec 2023 02:43:36 +0000
From: "Ebert,Timothy Aaron" <tebert using ufl.edu>
To: varin sacha <varinsacha using yahoo.fr>, "r-help using r-project.org"
<r-help using r-project.org>, Ben Bolker <bbolker using gmail.com>
Subject: Re: [R] ggplot2: Get the regression line with 95% confidence
bands
Message-ID:
<CH3PR22MB45144A83E3804933F8110101CF8DA using CH3PR22MB4514.namprd22.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"
Change year to a factor. Doing it in ggplot will not change the original data.
ggplot(df, aes(x = as.factor(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)
Regards,
Tim
-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of varin sacha via R-help
Sent: Tuesday, December 12, 2023 4:19 PM
To: r-help using r-project.org; Ben Bolker <bbolker using gmail.com>
Subject: Re: [R] ggplot2: Get the regression line with 95% confidence bands
[External Email]
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 using 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 using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://st/
>>> at.ethz.ch%2Fmailman%2Flistinfo%2Fr-help&data=05%7C02%7Ctebert%40ufl
>>> .edu%7C104a304ff93043a854a408dbfb5809c1%7C0d4da0f84a314d76ace60a6233
>>> 1e1b84%7C0%7C0%7C638380127776926039%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C
>>> %7C%7C&sdata=vDkrWWPIys%2FfrA00nTpEHWiYps3U6L6g4ACFkRs%2Fcmw%3D&rese
>>> rved=0
>>> PLEASE do read the posting guide
>>> http://www/
>>> .r-project.org%2Fposting-guide.html&data=05%7C02%7Ctebert%40ufl.edu%
>>> 7C104a304ff93043a854a408dbfb5809c1%7C0d4da0f84a314d76ace60a62331e1b8
>>> 4%7C0%7C0%7C638380127776926039%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
>>> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7
>>> C&sdata=hcvic6lEhrl4XpgEIctV4zhjz6ZgI9nWAHF4vLUbJyc%3D&reserved=0
>>> 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 using 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 using 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: 7
Date: Wed, 13 Dec 2023 03:37:10 +0000
From: "Ebert,Timothy Aaron" <tebert using ufl.edu>
To: Bert Gunter <bgunter.4567 using gmail.com>, Kevin Zembower
<kevin using zembower.org>
Cc: R-help email list <r-help using r-project.org>
Subject: Re: [R] Advice on starting to analyze smokestack emissions?
Message-ID:
<CH3PR22MB45145A73122C44FD69FD2547CF8DA using CH3PR22MB4514.namprd22.prod.outlook.com>
Content-Type: text/plain; charset="utf-8"
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 using r-project.org> On Behalf Of Bert Gunter
Sent: Tuesday, December 12, 2023 10:53 AM
To: Kevin Zembower <kevin using zembower.org>
Cc: R-help email list <r-help using 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 using 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 using 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 using 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 using gmail.com>
To: Bert Gunter <bgunter.4567 using gmail.com>
Cc: Kevin Zembower <kevin using zembower.org>, R-help email list
<r-help using r-project.org>
Subject: Re: [R] Advice on starting to analyze smokestack emissions?
Message-ID:
<CABcYAdLBgCy2b-QTOaedQ6dAo-LfuCHsDS6LgufbE1S0SByP3A using 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 using 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 using 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 using 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 using 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 using gmail.com>
To: "Ebert,Timothy Aaron" <tebert using ufl.edu>
Cc: Kevin Zembower <kevin using zembower.org>, R-help email list
<r-help using r-project.org>
Subject: Re: [R] Advice on starting to analyze smokestack emissions?
Message-ID:
<CAGxFJbRZ6L8XWGWOm404j2R2GvHtdy+TEPgTrTrW_ngPFvMS=Q using 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 using 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 using r-project.org> On Behalf Of Bert Gunter
> Sent: Tuesday, December 12, 2023 10:53 AM
> To: Kevin Zembower <kevin using zembower.org>
> Cc: R-help email list <r-help using 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 using 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 using 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 using 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 using sapo.pt>
To: Robert Baer <rbaer using atsu.edu>, varin sacha <varinsacha using yahoo.fr>,
"r-help using r-project.org" <r-help using r-project.org>, Ben Bolker
<bbolker using gmail.com>
Subject: Re: [R] ggplot2: Get the regression line with 95% confidence
bands
Message-ID: <42a94897-80e8-4a89-918d-769b1b2eeadd using 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 using 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 using 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 using 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 using 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 using 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 using nanx.me>
To: r-packages using r-project.org
Subject: [R] [R-pkgs] simtrial: Clinical Trial Simulation
Message-ID: <79834370-a2ad-4a6a-8b55-19b29e998f8a using 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 using r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages
------------------------------
Subject: Digest Footer
_______________________________________________
R-help using 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
***************************************
More information about the R-help
mailing list