我想创建一个显示条形图的图表,指示每个站点收集数据的时间长度。在下面的数据框中,我为每个log.start
的开始时间(log.end
)和结束时间(site
)列。我想要一张图表,日期在x轴上,站点在y轴上。
df <- structure(list(site = c("APIS01", "APIS02", "APIS03", "APIS04",
"APIS05", "APIS06", "APIS07", "APIS08", "APIS10", "APIS11"),
log.start = structure(c(17622, 17622, 17655, 17655, 17655,
17655, 17655, 17655, 17655, 17655), class = "Date"), log.end = structure(c(17780,
17756, 17785, 17784, 17784, 17784, 17756, 17784, 17785, 17713
), class = "Date"), park = c("APIS", "APIS", "APIS", "APIS",
"APIS", "APIS", "APIS", "APIS", "APIS", "APIS")), .Names = c("site",
"log.start", "log.end", "park"), row.names = c(NA, 10L), class = "data.frame")
谢谢
答案 0 :(得分:1)
您可以在此处轻松使用geom_segment
const renderAddress = event => {
const base = (
{event.venue.address.address_1}
<br />
{event.venue.address.city}
<br />
{event.venue.address.postal_code}
)
if (event.venue.address.address_2) {
return (
<address>
{event.venue.address.address_2}
<br />
{base}
</address>
)
} else {
return (
<address>
{base}
</address>
)
}
}