Discussion:
errorbar
KAMALAKKANNAN SRINIVASAN
2018-07-21 18:29:25 UTC
Permalink
I used this code and got warning as below. dataframe does not have missing
values.but few 0 values. Any suggestion to remove this?.

p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
52 color = QTR), width=1,size =.4, position=pd)

WARNING: R: Removed 3 rows containing missing values (geom_errorbar).
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Brandon Hurr
2018-07-21 19:14:39 UTC
Permalink
“dataframe does not have missing values”

https://m.imgur.com/gallery/okp66FD


It is just a warning but if you don’t think you have missing values and it
says you do, you should probably figure that out.

We can help you if you can produce a fully reproducible example. See the
footnote of this email for more information on how to do this.

B
Post by KAMALAKKANNAN SRINIVASAN
I used this code and got warning as below. dataframe does not have
missing values.but few 0 values. Any suggestion to remove this?.
p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
52 color = QTR), width=1,size =.4, position=pd)
WARNING: R: Removed 3 rows containing missing values (geom_errorbar).
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
KAMALAKKANNAN SRINIVASAN
2018-07-21 20:07:15 UTC
Permalink
dput(pk)
list(list(list(structure(list(QTR = c("Q4", "Q1", "Q2", "Q3",
"Q4", "Q1", "Q2", "Q3", "Q4", "Q1", "Q2", "Q3", "Q4", "Q1", "Q2",
"Q3", "Q4", "Q1", "Q2", "Q3", "Q4", "Placebo", "Placebo", "Placebo",
"Placebo", "Placebo", "Placebo", "Placebo", "Q1", "Q2", "Q3",
"Q4"), AVISIT = structure(c("Baseline", "Week 12", "Week 12",
"Week 12", "Week 12", "Week 16", "Week 16", "Week 16", "Week 16",
"Week 2", "Week 2", "Week 2", "Week 2", "Week 4", "Week 4", "Week 4",
"Week 4", "Week 8", "Week 8", "Week 8", "Week 8", "Baseline",
"Week 12", "Week 16", "Week 2", "Week 4", "Week 8", "", "", "",
"", ""), label = "Analysis Visit"), NDY = structure(c(0, 84,
84, 84, 84, 112, 112, 112, 112, 14, 14, 14, 14, 28, 28, 28, 28,
56, 56, 56, 56, 0, 84, 112, 14, 28, 56, 0, 0, 0, 0, 0), label = "Nominal
Relative Day", format.sas = "BEST"),
NOBS = structure(c(161, 37, 40, 39, 40, 36, 39, 39, 40, 39,
41, 39, 41, 38, 41, 40, 41, 36, 38, 39, 40, 82, 81, 76, 83,
80, 77, NA, NA, NA, NA, NA), label = "N Obs", format.sas = "BEST"),
PCHGL_N = structure(c(161, 37, 40, 39, 40, 36, 39, 39, 40,
39, 41, 39, 41, 38, 41, 40, 41, 36, 38, 39, 40, 82, 81, 76,
83, 80, 77, 0, 0, 0, 0, 0), label = "N", format.sas = "BEST"),
PCHGL_MEAN = structure(c(0, -53.5357793895221, -60.8586031892245,
-64.0155211137336, -69.4356613566738, -48.8205073198779,
-57.7990329951949, -66.2084803533085, -70.6414351298854,
-28.2209297150877, -36.3116025747556, -37.7630294363122,
-43.2442569929364, -47.8310860836003, -61.5587482949542,
-58.272793346691, -55.2594836792071, -52.5651345827878,
-61.8170386944082,
-62.9796663860989, -69.7607916827073, 0, -17.7054380188172,
-15.8856190748691, -12.4166868013793, -17.9346567124447,
-16.5660513075025, 0, 0, 0, 0, 0), label = "Mean", format.sas =
"BEST"),
PCHGL_STDDEV = structure(c(0, 34.0993470000362, 33.3751100731627,
23.4730849213086, 28.8783077805662, 35.0729415715529, 34.8105467229118,
27.6778861704015, 30.2458480384026, 28.1425618569023, 24.9260234006849,
36.7916297853081, 25.9663312930781, 30.0646107316322, 26.6443108339164,
27.2673364492213, 29.9969075509632, 36.5874738326123, 30.0752986232253,
25.5074562465454, 27.8803179469641, 0, 40.7630548879959,
41.890069629592, 30.0198988565116, 36.1948298283662, 36.0920037934488,
0, 0, 0, 0, 0), label = "Std Dev", format.sas = "BEST"),
QTR1 = c("Q4161)", "Q137)", "Q240)", "Q339)", "Q440)", "Q136)",
"Q239)", "Q339)", "Q440)", "Q139)", "Q241)", "Q339)", "Q441)",
"Q138)", "Q241)", "Q340)", "Q441)", "Q136)", "Q238)", "Q339)",
"Q440)", "Placebo82)", "Placebo81)", "Placebo76)", "Placebo83)",
"Placebo80)", "Placebo77)", "", "", "", "", "")), label = "TEST",
row.names = c(NA,
-32L), class = c("tbl_df", "tbl", "data.frame")))))
pk = structure(list(pk))
pk
[[1]]
[[1]][[1]]
[[1]][[1]][[1]]
[[1]][[1]][[1]][[1]]
# A tibble: 32 x 8
QTR AVISIT NDY NOBS PCHGL_N PCHGL_MEAN PCHGL_STDDEV QTR1
<chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
1 Q4 Baseline 0 161 161 0 0 Q4161)
2 Q1 Week 12 84 37 37 -53.5 34.1 Q137)
3 Q2 Week 12 84 40 40 -60.9 33.4 Q240)
4 Q3 Week 12 84 39 39 -64.0 23.5 Q339)
5 Q4 Week 12 84 40 40 -69.4 28.9 Q440)
6 Q1 Week 16 112 36 36 -48.8 35.1 Q136)
7 Q2 Week 16 112 39 39 -57.8 34.8 Q239)
8 Q3 Week 16 112 39 39 -66.2 27.7 Q339)
9 Q4 Week 16 112 40 40 -70.6 30.2 Q440)
10 Q1 Week 2 14 39 39 -28.2 28.1 Q139)
# ... with 22 more rows



#############################################################################################################
library(ggplot2)
pd <- position_dodge(0.2)
#GGPLOT
p = ggplot(pk,aes(NDY/7, PCHGL_MEAN, group = QTR))
Warning messages:
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
#POINT, LINE
p = p + geom_point((aes(color = QTR, shape = QTR)),size = 1) +
+ scale_shape_manual(values=c(0,1,2,15,17,1,2,4,5,6)) +
+
+ geom_line((aes(color = QTR,linetype = QTR)),
+ show.legend = FALSE, size = .4) +
+ scale_linetype_manual(values=c(1,2,4,5,6,1,2,4,5,6))
Scale for 'shape' is already present. Adding another scale for 'shape',
which will replace the
existing scale.
Scale for 'linetype' is already present. Adding another scale for
'linetype', which will replace
the existing scale.
p
Warning messages:
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
#BACKGROUND COLOR, SCALE
p = p + theme_bw() + scale_x_continuous(breaks = seq(0,16,2),limits =
c(0,17))+
+ scale_y_continuous(breaks=seq(-120,40,20)) +
+ expand_limits(y = c(-120,40))
Scale for 'x' is already present. Adding another scale for 'x', which will
replace the existing
scale.
Scale for 'y' is already present. Adding another scale for 'y', which will
replace the existing
scale.
p
Warning messages:
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
# ERROR BAR
p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
+ color = QTR), width=1,size =.4, position=pd)
p
Warning messages:
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
#PANEL
p = p + theme(panel.border = element_rect(fill = NA, colour = "black",
size = 1))
p
Warning messages:
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
#LEGEND
p = p + theme(legend.position= 'bottom', legend.direction = 'horizontal',
+ legend.background=element_rect(fill="white",
colour="black", size = .6),
+ legend.title = element_blank(),
+ legend.text = element_text(size = 6, face = 'bold'))
p
Warning messages:
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
# AXIS LABELS-TEXT SIZE, THICKNESS, LIMITS
p = p + labs(x = 'Nominal Time (Week)', y = 'EASI Mean % Change From
Baseline (LOCF)' )
p = p + theme(axis.title = element_text(size = 7, face = 'bold'),
+ axis.text = element_text(face="bold", size=6))
p
Warning messages:
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
“dataframe does not have missing values”
https://m.imgur.com/gallery/okp66FD
It is just a warning but if you don’t think you have missing values and it
says you do, you should probably figure that out.
We can help you if you can produce a fully reproducible example. See the
footnote of this email for more information on how to do this.
B
Post by KAMALAKKANNAN SRINIVASAN
I used this code and got warning as below. dataframe does not have
missing values.but few 0 values. Any suggestion to remove this?.
p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
52 color = QTR), width=1,size =.4, position=pd)
WARNING: R: Removed 3 rows containing missing values (geom_errorbar).
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups
"ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ben Bond-Lamberty
2018-07-22 02:06:28 UTC
Permalink
I don't know why, exactly, but that warning is occurring because you have
duplicate rows (specifically, multiple Placebo and Q4 observations at
NDY=0). If you remove the duplicates, the code doesn't produce any warning.

pk1 <- subset(pk1, !duplicated(pk1))

Ben




On Sat, Jul 21, 2018 at 4:07 PM KAMALAKKANNAN SRINIVASAN <
Post by KAMALAKKANNAN SRINIVASAN
dput(pk)
list(list(list(structure(list(QTR = c("Q4", "Q1", "Q2", "Q3",
"Q4", "Q1", "Q2", "Q3", "Q4", "Q1", "Q2", "Q3", "Q4", "Q1", "Q2",
"Q3", "Q4", "Q1", "Q2", "Q3", "Q4", "Placebo", "Placebo", "Placebo",
"Placebo", "Placebo", "Placebo", "Placebo", "Q1", "Q2", "Q3",
"Q4"), AVISIT = structure(c("Baseline", "Week 12", "Week 12",
"Week 12", "Week 12", "Week 16", "Week 16", "Week 16", "Week 16",
"Week 2", "Week 2", "Week 2", "Week 2", "Week 4", "Week 4", "Week 4",
"Week 4", "Week 8", "Week 8", "Week 8", "Week 8", "Baseline",
"Week 12", "Week 16", "Week 2", "Week 4", "Week 8", "", "", "",
"", ""), label = "Analysis Visit"), NDY = structure(c(0, 84,
84, 84, 84, 112, 112, 112, 112, 14, 14, 14, 14, 28, 28, 28, 28,
56, 56, 56, 56, 0, 84, 112, 14, 28, 56, 0, 0, 0, 0, 0), label = "Nominal
Relative Day", format.sas = "BEST"),
NOBS = structure(c(161, 37, 40, 39, 40, 36, 39, 39, 40, 39,
41, 39, 41, 38, 41, 40, 41, 36, 38, 39, 40, 82, 81, 76, 83,
80, 77, NA, NA, NA, NA, NA), label = "N Obs", format.sas = "BEST"),
PCHGL_N = structure(c(161, 37, 40, 39, 40, 36, 39, 39, 40,
39, 41, 39, 41, 38, 41, 40, 41, 36, 38, 39, 40, 82, 81, 76,
83, 80, 77, 0, 0, 0, 0, 0), label = "N", format.sas = "BEST"),
PCHGL_MEAN = structure(c(0, -53.5357793895221, -60.8586031892245,
-64.0155211137336, -69.4356613566738, -48.8205073198779,
-57.7990329951949, -66.2084803533085, -70.6414351298854,
-28.2209297150877, -36.3116025747556, -37.7630294363122,
-43.2442569929364, -47.8310860836003, -61.5587482949542,
-58.272793346691, -55.2594836792071, -52.5651345827878,
-61.8170386944082,
-62.9796663860989, -69.7607916827073, 0, -17.7054380188172,
-15.8856190748691, -12.4166868013793, -17.9346567124447,
-16.5660513075025, 0, 0, 0, 0, 0), label = "Mean", format.sas =
"BEST"),
PCHGL_STDDEV = structure(c(0, 34.0993470000362, 33.3751100731627,
23.4730849213086, 28.8783077805662, 35.0729415715529,
34.8105467229118,
27.6778861704015, 30.2458480384026, 28.1425618569023,
24.9260234006849,
36.7916297853081, 25.9663312930781, 30.0646107316322,
26.6443108339164,
27.2673364492213, 29.9969075509632, 36.5874738326123,
30.0752986232253,
25.5074562465454, 27.8803179469641, 0, 40.7630548879959,
41.890069629592, 30.0198988565116, 36.1948298283662, 36.0920037934488,
0, 0, 0, 0, 0), label = "Std Dev", format.sas = "BEST"),
QTR1 = c("Q4161)", "Q137)", "Q240)", "Q339)", "Q440)", "Q136)",
"Q239)", "Q339)", "Q440)", "Q139)", "Q241)", "Q339)", "Q441)",
"Q138)", "Q241)", "Q340)", "Q441)", "Q136)", "Q238)", "Q339)",
"Q440)", "Placebo82)", "Placebo81)", "Placebo76)", "Placebo83)",
"Placebo80)", "Placebo77)", "", "", "", "", "")), label = "TEST",
row.names = c(NA,
-32L), class = c("tbl_df", "tbl", "data.frame")))))
pk = structure(list(pk))
pk
[[1]]
[[1]][[1]]
[[1]][[1]][[1]]
[[1]][[1]][[1]][[1]]
# A tibble: 32 x 8
QTR AVISIT NDY NOBS PCHGL_N PCHGL_MEAN PCHGL_STDDEV QTR1
<chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr>
1 Q4 Baseline 0 161 161 0 0 Q4161)
2 Q1 Week 12 84 37 37 -53.5 34.1 Q137)
3 Q2 Week 12 84 40 40 -60.9 33.4 Q240)
4 Q3 Week 12 84 39 39 -64.0 23.5 Q339)
5 Q4 Week 12 84 40 40 -69.4 28.9 Q440)
6 Q1 Week 16 112 36 36 -48.8 35.1 Q136)
7 Q2 Week 16 112 39 39 -57.8 34.8 Q239)
8 Q3 Week 16 112 39 39 -66.2 27.7 Q339)
9 Q4 Week 16 112 40 40 -70.6 30.2 Q440)
10 Q1 Week 2 14 39 39 -28.2 28.1 Q139)
# ... with 22 more rows
#############################################################################################################
library(ggplot2)
pd <- position_dodge(0.2)
#GGPLOT
p = ggplot(pk,aes(NDY/7, PCHGL_MEAN, group = QTR))
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
#POINT, LINE
p = p + geom_point((aes(color = QTR, shape = QTR)),size = 1) +
+ scale_shape_manual(values=c(0,1,2,15,17,1,2,4,5,6)) +
+
+ geom_line((aes(color = QTR,linetype = QTR)),
+ show.legend = FALSE, size = .4) +
+ scale_linetype_manual(values=c(1,2,4,5,6,1,2,4,5,6))
Scale for 'shape' is already present. Adding another scale for 'shape',
which will replace the
existing scale.
Scale for 'linetype' is already present. Adding another scale for
'linetype', which will replace
the existing scale.
p
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
#BACKGROUND COLOR, SCALE
p = p + theme_bw() + scale_x_continuous(breaks = seq(0,16,2),limits =
c(0,17))+
+ scale_y_continuous(breaks=seq(-120,40,20)) +
+ expand_limits(y = c(-120,40))
Scale for 'x' is already present. Adding another scale for 'x', which will
replace the existing
scale.
Scale for 'y' is already present. Adding another scale for 'y', which will
replace the existing
scale.
p
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
# ERROR BAR
p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
+ color = QTR), width=1,size =.4, position=pd)
p
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
#PANEL
p = p + theme(panel.border = element_rect(fill = NA, colour = "black",
size = 1))
p
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
#LEGEND
p = p + theme(legend.position= 'bottom', legend.direction = 'horizontal',
+ legend.background=element_rect(fill="white",
colour="black", size = .6),
+ legend.title = element_blank(),
+ legend.text = element_text(size = 6, face = 'bold'))
p
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
# AXIS LABELS-TEXT SIZE, THICKNESS, LIMITS
p = p + labs(x = 'Nominal Time (Week)', y = 'EASI Mean % Change From
Baseline (LOCF)' )
p = p + theme(axis.title = element_text(size = 7, face = 'bold'),
+ axis.text = element_text(face="bold", size=6))
p
1: Removed 3 rows containing missing values (geom_errorbar).
2: Removed 3 rows containing missing values (geom_errorbar).
3: Removed 3 rows containing missing values (geom_errorbar).
4: Removed 3 rows containing missing values (geom_errorbar).
“dataframe does not have missing values”
https://m.imgur.com/gallery/okp66FD
It is just a warning but if you don’t think you have missing values and
it says you do, you should probably figure that out.
We can help you if you can produce a fully reproducible example. See the
footnote of this email for more information on how to do this.
B
On Sat, Jul 21, 2018 at 11:29 KAMALAKKANNAN SRINIVASAN <
Post by KAMALAKKANNAN SRINIVASAN
I used this code and got warning as below. dataframe does not have
missing values.but few 0 values. Any suggestion to remove this?.
p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
52 color = QTR), width=1,size =.4, position=pd)
WARNING: R: Removed 3 rows containing missing values (geom_errorbar).
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google
Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
KAMALAKKANNAN SRINIVASAN
2018-07-21 23:06:02 UTC
Permalink
Here is full reproducible code with data. It generates warning as "WARNING:
R: Removed 3 rows containing missing values (geom_errorbar). Any
suggestion please to remove this?. Thanks.

pk1=structure(list(QTR = c("Q4", "Q1", "Q2", "Q3", "Q4", "Q1", "Q2",
"Q3", "Q4", "Q1", "Q2", "Q3", "Q4", "Q1", "Q2",
"Q3", "Q4", "Q1",
"Q2", "Q3", "Q4", "Placebo", "Placebo",
"Placebo", "Placebo",
"Placebo", "Placebo", "Placebo", "Q1", "Q2",
"Q3", "Q4"),
NDY = structure(c(0, 84, 84, 84, 84, 112, 112, 112, 112,
14, 14, 14, 14, 28, 28, 28,

28, 56, 56, 56, 56, 0, 84, 112, 14, 28, 56, 0,
0, 0, 0, 0), label = "Nominal Relative Day", format.sas = "BEST"),
PCHGL_MEAN = structure(c(0, -53.5357793895221,
-60.8586031892245,
-64.0155211137336,
-69.4356613566738, -48.8205073198779,
-57.7990329951949,
-66.2084803533085, -70.6414351298854,
-28.2209297150877,
-36.3116025747556, -37.7630294363122,
-43.2442569929364,
-47.8310860836003, -61.5587482949542,
-58.272793346691,
-55.2594836792071, -52.5651345827878, -61.8170386944082,
-62.9796663860989,
-69.7607916827073, 0, -17.7054380188172,
-15.8856190748691,
-12.4166868013793, -17.9346567124447,
-16.5660513075025, 0, 0, 0, 0,
0), label = "Mean", format.sas = "BEST"),
PCHGL_STDDEV = structure(c(0, 34.0993470000362,
33.3751100731627,
23.4730849213086,
28.8783077805662, 35.0729415715529, 34.8105467229118,
27.6778861704015,
30.2458480384026, 28.1425618569023, 24.9260234006849,
36.7916297853081,
25.9663312930781, 30.0646107316322, 26.6443108339164,
27.2673364492213,
29.9969075509632, 36.5874738326123, 30.0752986232253,
25.5074562465454,
27.8803179469641, 0, 40.7630548879959,
41.890069629592,
30.0198988565116, 36.1948298283662, 36.0920037934488,
0, 0, 0, 0, 0), label = "Std
Dev", format.sas = "BEST")), label = "TEST", row.names = c(NA,

-32L), class =
c("tbl_df", "tbl", "data.frame"))
pk1
library(ggplot2)

pd <- position_dodge(0.2)

#GGPLOT

p = ggplot(pk1,aes(NDY/7, PCHGL_MEAN, group = QTR))
p

#POINT, LINE

p = p + geom_point((aes(color = QTR, shape = QTR)),size = 1) +
scale_shape_manual(values=c(0,1,2,15,17,1,2,4,5,6)) +

geom_line((aes(color = QTR,linetype = QTR)),
show.legend = FALSE, size = .4) +
scale_linetype_manual(values=c(1,2,4,5,6,1,2,4,5,6))
p

#BACKGROUND COLOR, SCALE

p = p + theme_bw() + scale_x_continuous(breaks = seq(0,16,2),limits =
c(0,17))+
scale_y_continuous(breaks=seq(-120,40,20)) +
expand_limits(y = c(-120,40))
p
# ERROR BAR

p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
color = QTR), width=1,size =.4, position=pd)
p

#PANEL

p = p + theme(panel.border = element_rect(fill = NA, colour = "black", size
= 1))
p

#LEGEND

p = p + theme(legend.position= 'bottom', legend.direction = 'horizontal',
legend.background=element_rect(fill="white", colour="black",
size = .6),
legend.title = element_blank(),
legend.text = element_text(size = 6, face = 'bold'))
p

# AXIS LABELS-TEXT SIZE, THICKNESS, LIMITS

p = p + labs(x = 'Nominal Time (Week)', y = 'EASI Mean % Change From
Baseline (LOCF)' )
p = p + theme(axis.title = element_text(size = 7, face = 'bold'),
axis.text = element_text(face="bold", size=6))
p
Post by Brandon Hurr
“dataframe does not have missing values”
https://m.imgur.com/gallery/okp66FD
It is just a warning but if you don’t think you have missing values and it
says you do, you should probably figure that out.
We can help you if you can produce a fully reproducible example. See the
footnote of this email for more information on how to do this.
B
Post by KAMALAKKANNAN SRINIVASAN
I used this code and got warning as below. dataframe does not have
missing values.but few 0 values. Any suggestion to remove this?.
p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
52 color = QTR), width=1,size =.4, position=pd)
WARNING: R: Removed 3 rows containing missing values (geom_errorbar).
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups
"ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
KAMALAKKANNAN SRINIVASAN
2018-07-21 19:56:07 UTC
Permalink
On Saturday, July 21, 2018 at 2:29:25 PM UTC-4, KAMALAKKANNAN SRINIVASAN
Post by KAMALAKKANNAN SRINIVASAN
I used this code and got warning as below. dataframe does not have
missing values.but few 0 values. Any suggestion to remove this?.
p=p+geom_errorbar(aes(ymin = PCHGL_MEAN-PCHGL_STDDEV, ymax =
PCHGL_MEAN+PCHGL_STDDEV,
52 color = QTR), width=1,size =.4, position=pd)
WARNING: R: Removed 3 rows containing missing values (geom_errorbar).
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...