Hi David,
No, read.table converts a text representation of data into a data frame object.
Jim
On Sat, Sep 24, 2022 at 2:29 AM DFP wrote:
>
> Do I need that read.table if the tst dataframe already exists in my
> system? If so, why?
>
> --
>
> Hello
Do I need that read.table if the tst dataframe already exists in my
system? If so, why?
--
Hello,
You have to load the packages involved:
library(dplyr)
library(tidyr)
library(ggplot2)
then run the full sequence. Though this is not important,
That worked, and helped my understanding. Thank you.
Hello,
You have to load the packages involved:
library(dplyr)
library(tidyr)
library(ggplot2)
then run the full sequence. Though this is not important, if you are
pivotting columnns named y1 and y2
No you don't! I do!
I don't have tst on my system.
Rui Barradas
Às 22:11 de 22/09/2022, DFP escreveu:
Do I need that read.table if the tst dataframe already exists in my
system? If so, why?
--
Hello,
You have to load the packages involved:
Hello,
You have to load the packages involved:
library(dplyr)
library(tidyr)
library(ggplot2)
then run the full sequence. Though this is not important, if you are
pivotting columnns named y1 and y2, why not name the result just y?
pivot_longer(-time, names_to = "y")
And here is complete
I'm trying to do as you suggest, but I'm not understanding what I need
to do. I asked what the line pivot_longer(-time, names_to = "y1") would
do if applied to this df:
> tst
time y1 y2
1 18:55 30 19
2 18:56 30 19
3 18:57 29 19
4 18:58 31 19
5 18:59 28 19
6 19:00 28 19
7 19:01 28 19
Hello,
This type of problems generally has to do with reshaping the data. The
format should be the long format and the data is in wide format.
Inline.
Às 23:35 de 21/09/2022, DFP escreveu:
As I said, the lines below that you provided worked well for me. Can you
explain what this line does?:
p On Behalf Of DFP
Sent: Wednesday, September 21, 2022 6:35 PM
To: Rui Barradas ; r-help@r-project.org
Subject: Re: [R] Need help plotting
[External Email]
As I said, the lines below that you provided worked well for me. Can you
explain what this line does?:
# reshape to long format
pivot_l
As I said, the lines below that you provided worked well for me. Can you
explain what this line does?:
# reshape to long format
pivot_longer(-Dtime, names_to = "NO2") %>%
-
library(ggplot2)
library(dplyr)
library(tidyr)
b %>%
mutate(Dtime
rg
Subject: Re: [R] Need help plotting
[External Email]
"Also, IU's tech support told me yesterday that if I responded to a message
that came as plain text, my response would go out as plain text. Is that true
for this response, or is it in HTML?"
Nope, HTML. You need to set you
esterday that if I responded to a message
> that came as plain text, my response would go out as plain text. Is that
> true for this response, or is it in HTML?
>
> From: Rui Barradas
> Date: Tuesday, September 20, 2022 at 4:52 AM
> To: Jim Lemon , Parkhurst, David <
> parkh...
go out as plain text. Is that true for
this response, or is it in HTML?
From: Rui Barradas
Date: Tuesday, September 20, 2022 at 4:52 AM
To: Jim Lemon , Parkhurst, David ,
r-help mailing list
Subject: Re: [R] Need help plotting
Hello,
Now with data, here are base R and ggplot2 plots.
Hello,
Now with data, here are base R and ggplot2 plots.
b <- read.table(text=
"Dtime DNO2 DVOC Dpm10Dpm2.5 Dpm1 Mtime MNO2
MVOCMpm10 Mpm2.5 Mpm1
18:00 28 164 81.34773 24.695435 14 18:00 19 151 3.00
21
18:01 27 163 74.44034 23.751198 14 18
Hi David,
I'm back home again. Try this:
b<-read.table(text=
"Dtime DNO2 DVOC Dpm10Dpm2.5 Dpm1 Mtime MNO2 MVOCMpm10 Mpm2.5 Mpm1
18:00 28 164 81.34773 24.695435 14 18:00 19 151 3.00 21
18:01 27 163 74.44034 23.751198 14 18:01 20 148 3.00 21
Thank you.
DFP (iPad)
> On Sep 19, 2022, at 8:15 AM, Ebert,Timothy Aaron wrote:
>
> My version of this email has a bunch of ? that I do not know how to
> interpret. Emails to this group need to be in plain text. HTML content is
> deleted or converted and impossible or at least difficult to i
Hi David,
All I got was the rather cryptic "DFP (iPad)" below your message.
Whatever format you used for the data was blocked by the R-help mail
server. Try this command in your R session:
dput(test)
and cut and paste the output into your email. That should do it.
Jim
On Tue, Sep 20, 2022 at 7:
Hi David,
Since you used read.csv to get the data frame, the file must be i text
format. If you can include a few lines of the input (with made up NO2
values if necessary), it would be easy to respond with the required
commands and a plot.
Jim
On Mon, Sep 19, 2022 at 9:12 PM Parkhurst, David wro
David,
Do these work for you? (I am resending this so others can see. The original
only went to you.)
library(lubridate)
a<-c(4, 5, 6)
b<-c("18:00", "18:01", "18:02")
c<-as.data.frame(cbind(a,b))
c$d<-hm(c$b)
c$d$minute[2]
I could do it manually like this (where FrHour is fractional hour)
a<-
See ?date-time and/or ?strptime for how to convert what I presume is
character data in your datetime column to a POSIXct object. (you may first
need to convert from a factor to character with as.character() ). Then
follow Tim's prescription for ggplot or see ?axis.Date (especially the
examples) for
My version of this email has a bunch of ? that I do not know how to interpret.
Emails to this group need to be in plain text. HTML content is deleted or
converted and impossible or at least difficult to interpret.
Do not share confidential data. Please change some numbers or variable names
and
The abline function works fine for simple linear regression because there
is only 1 line, but with multiple linear regression there are an infinite
number of lines and you need to decide which to plot (or find a way to plot
t he plane/hyperplane/surface/etc.).
One option is to use the Predict.Plot
Hi
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Craig O'Connell
> Sent: Wednesday, February 13, 2013 11:03 PM
> To: r-help@r-project.org
> Subject: [R] Need Help Plotting "Line" for multiple linear regression
>
> Hello,
>
22 matches
Mail list logo