annotate("text", x=date[2], y=.8, label="OOC",size=6,fontface="bold")+
annotate("text", x=date[2], y=-.05, label="PT Not
Done",size=5,fontface="bold")
Cheers
Petr
> -Original Message-
> From: R-help On Behalf Of Thom
On Wed, 4 Jan 2023, 21:29 Ebert,Timothy Aaron, wrote:
>
> As you are plotting strings, you could put a space character in front of
> the December dates so that they are first.
> date<-c(" 12-29"," 12-30","01-01")
> That fixes the problem in this example. You can order all the dates by
> putting m
Às 21:08 de 04/01/2023, Thomas Subia escreveu:
Colleagues,
date<-c("12-29","12-30","01-01")
PT <- c(.106,.130,.121)
data <- data.frame(date,PT)
ggplot(data, aes(x=date,y=PT,group=1))+
geom_point(size=4)+
geom_line()+
geom_hline(yintercept =c(1,.60,0,.30,.25,.2))+
scale_y_continuous(
lier years. That will get messy.
Tim
-Original Message-
From: R-help On Behalf Of Thomas Subia
Sent: Wednesday, January 4, 2023 4:08 PM
To: r-help@r-project.org
Subject: [R] Date order question
[External Email]
Colleagues,
date<-c("12-29","12-30","01-01")
PT
I converted `date` to a factor and it seemed to work:
```
library(ggplot2)
library(cowplot)
date <- c("12-29","12-30","01-01")
date <- factor(date, labels = unique(date))
PT <- c(.106,.130,.121)
data <- data.frame(date,PT)
ggplot(data, aes(x=date,y=PT,group=1))+
geom_point(size=4)+
geom_line(
Colleagues,
date<-c("12-29","12-30","01-01")
PT <- c(.106,.130,.121)
data <- data.frame(date,PT)
ggplot(data, aes(x=date,y=PT,group=1))+
geom_point(size=4)+
geom_line()+
geom_hline(yintercept =c(1,.60,0,.30,.25,.2))+
scale_y_continuous(label=scales::label_percent(),breaks=c(1,0.6,0,.3,0.2
6 matches
Mail list logo