我在Tableau中制作了以下图表,并想在R中复制它:
我已经从Tableau中的图表中提取了数据,这就是前10行数据的样子;
window.opener.postMessage({success: this.state.success}, this.state.page);
答案 0 :(得分:0)
我不确定您要做什么,但是您可能需要长格式的数据。要筛选不同的画布版本,您必须查看flexdashboard
或shiny
之类的内容,供用户选择,或者在生成报告时进行循环。
看看这是否可以帮助您概念化可能的解决方案
df_long <-
df %>%
select(
id = ID,
name = Stone.Name.L1,
contains("Canvas")
) %>%
# convert to long everything but id & name
gather(orig, value, -c(id, name)) %>%
# break the canvas and metric into 2 columns on the "."
separate(orig, into = c("canvas", "metric"), sep = "\\.") %>%
# covert to wide
spread(metric, value) %>%
rename(
x = AdjXRightValue,
y = AdjYTopValue,
quad = Quadrant
) %>%
filter(!is.na(x)) %>%
# some modifications to the vars
mutate(
x = as.numeric(x),
y = as.numeric(y),
quad = str_extract(quad, "(Low|Upp).*")
) %>%
# break quad into 2 columns (not sure you need this)
separate(quad, c("vert", "horiz"), remove = FALSE)
然后是情节
ggplot(df_long, aes(x, y, color = quad)) +
geom_point(size = 2) +
geom_hline(yintercept = 0.5) +
geom_vline(xintercept = 0.5) +
theme_minimal() +
theme(
legend.position = "none"
)