Discussion:
WARNING: Removed 3 rows containing missing values (geom_errorbar). - Reason?-Solution Please?
KAMALAKKANNAN SRINIVASAN
2018-07-21 23:28:21 UTC
Permalink
Here is full reproducible code with data. It generates warning as "WARNING:
R: Removed 3 rows containing missing values (geom_errorbar). No 'NA' s
in variables. 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
--
--
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.
t***@uni-bremen.de
2018-07-22 01:41:02 UTC
Permalink
Hi,
i dont know what exactly is going wrong, but p + facet_wrap(~QTR)
does not trigger the warning message.
This might help you tracing back the warning.
Post by KAMALAKKANNAN SRINIVASAN
R: Removed 3 rows containing missing values (geom_errorbar). No 'NA' s
in variables. 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
--
--
--
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.
Loading...