martin-borkovec / ggparty

147 stars 14 forks source link

Warnings when drawing tree #6

Closed HeidiSeibold closed 5 years ago

HeidiSeibold commented 5 years ago

When running the xample below I receive several warnings. Why?

  library("ggparty")
#> Loading required package: ggplot2
#> Loading required package: partykit
#> Loading required package: grid
#> Loading required package: libcoin
#> Loading required package: mvtnorm

  airq <- subset(airquality, !is.na(Ozone))
  airct <- ctree(Ozone ~ ., data = airq)

ggparty(airct) +
    geom_edge() +
    geom_edge_label() +
    geom_node_splitvar()
#> Warning: Removed 1 rows containing missing values (geom_segment).
#> Warning: Removed 1 rows containing missing values (geom_label).
#> Warning: Removed 5 rows containing missing values (geom_label).

Created on 2019-02-04 by the reprex package (v0.2.0).

martin-borkovec commented 5 years ago

due to the structure of the plot_data dataframe, there are always gonna be some missing values.

now it should work without the warnings.

HeidiSeibold commented 5 years ago

Ok, closing this!