我有一個名爲city的列,它有10多個不同的城市,並且這些值分散在10000行之外。現在我想根據10個城市中的特定城市進行一些探索性分析。 我寫currently-使用R中特定列的幾個值進行繪圖ggplot
ggplot(irdata,aes(x=City))+geom_histogram(binwidth=5)
ggplot(irdata, aes(x = City,y=50, fill = Section)) +geom_bar(stat = "identity", position = "dodge") + coord_flip()
在這兩個我使用所有這一切,我不希望城市繪製的。如何繪製使用一些特定的城市像
ggplot(irdata,aes(x=City=='Dublin'))+geom_histogram(binwidth=5)
但上面這段代碼無論如何也不會工作,因爲它會帶來與邏輯輸出/結果。
如果我有超過1個城市測試像都柏林,科克,倫敦..這樣 – 2014-08-29 14:19:34
使用irdata [irdata $%%c(「都柏林」,「科克」,「倫敦」),] – rnso 2014-08-29 16:06:16