2016-10-19 14 views
0

私はこの件にいくつかの投稿 を知っています。しかし、彼らは私を助けませんでした。私は1つのデータセットしか使用していませんが、このエラーは発生します。ggplot2はクラスの不均衡のデータを扱う方法を知らない

ggplot2 doesn't know how to deal with data of class uneval

wellmixed<-read.table("param_analysis_Spatial.txt",skip=1) 
wellmixed[is.na(wellmixed)] <- 0 

wellmixed %>% 
     group_by(V2) %>% 
     arrange(V1) %>% 
     mutate(ymin = (V1 + lag(V1))/2 
      , ymax = (V1 + lead(V1))/2 
      , xmin = V2 - 0.005 
      , xmax = V2 + 0.005 
      , ymin = ifelse(is.na(ymin), 0, ymin) 
      , ymax = ifelse(is.na(ymax), 0.16, ymax) 
        ) %>% 

    +  ggplot(aes(xmin = xmin 
       , xmax = xmax 
       , ymin = ymin 
       , ymax = ymax 
       , fill = V7)) + 
     geom_rect(data=wellmixed) 

それが理由>%%のでしょうか?

+0

なぜ '+' '前ggplot'がありますか? – Axeman

答えて

0

ggplot()の最初の引数がdata.frameでない場合、ggplot2 doesn't know how to deal with data of class unevalというメッセージが表示されます。 ggplotの最初の引数は、()は、あなたの美学である場合

、その後、次のように記述する必要があります。

ggplot(mapping = aes(...your aesthetics...)) 
関連する問題