Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid tree object when running ### Species Taxonomic Tree(物种分类树) #4

Open
finally-jay opened this issue Jul 25, 2023 · 0 comments

Comments

@finally-jay
Copy link

老师您好,
我在跑以下这段代码的时候出现了Error:
ℹ invalid tbl_tree object. Missing column: parent,node.
ℹ invalid tbl_tree object. Missing column: parent,node.
Error in if (stats::var(as.numeric(dat[[xid]]), na.rm = TRUE) != 0) { :
missing value where TRUE/FALSE needed

我没有找到解决办法, 请问可否给一点提示? 比如tree object 在哪里被调用的? 谢谢老师!

Species Taxonomic Tree(物种分类树)

....
otu$id = row.names(otu)
ringdat = otu %>% tidyfst::longer_dt(id)
ringdat$value = log2(ringdat$value+1)
ringdat$id = paste("st__",ringdat$id,sep = "")
head(ringdat)
num <- ringdat$name %>% unique() %>% length()
p3 <- p2 +
geom_fruit(
data=ringdat,
geom=geom_star,
mapping=aes(
y=id,
x=name,
size=value,
fill= name
),
starshape = 13,
starstroke = 0,
offset=-0.9,
pwidth=0.8,
grid.params=list(linetype=3)
) +
scale_size_continuous(range=c(0, 2),
limits=c(sort(ringdat$value)[2], max(ringdat$value)),
breaks=c(1, 2, 3),
name=bquote(paste(Log[2],"(",.("Count+1"), ")")),
guide=guide_legend(keywidth = 0.4, keyheight = 0.4, order=4,
override.aes = list(starstroke=0.3))
) +
scale_fill_manual(
values=colorRampPalette(RColorBrewer::brewer.pal(12,"Spectral"))(num),
guide=guide_legend(keywidth = 0.4, keyheight = 0.4, order=3)
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant