这是我的代码:
ggplot(data = samplesolution2, aes(x = transdt, y = transAmount, group = bankAcctID, fill = bankAcctID)) +
geom_bar(stat = "identity") +
geom_test(label = rownames(data), nudge_x = 0.25, nudge_y = 0.25, check_overlap = T) +
ggtitle(label = "Showing Only Total Deposits Over $200") +
facet_wrap(~ bankAcctID, ncol = 1)
Error in geom_test(label = rownames(data), nudge_x = 0.25, nudge_y = 0.25, :
could not find function "geom_test"
我想在每个小节内添加x和y值。
答案 0 :(得分:1)
我认为您有两个问题:
geom_text
中的错字rownames
的调用中使用data.frame的名称,而不是“ data”。ggplot(data = samplesolution2,
aes(x = transdt, y = transAmount, group = bankAcctID, fill = bankAcctID)) +
geom_bar(stat = "identity") +
geom_text(label = rownames(samplesolution2), nudge_x = 0.25, nudge_y = 0.25, check_overlap = T) +
ggtitle(label = "Showing Only Total Deposits Over $200") +
facet_wrap(~ bankAcctID, ncol = 1)