gpt4 book ai didi

r - R 包中的 ggplot2 : Notes during CRAN tests

转载 作者:行者123 更新时间:2023-12-04 12:26:22 25 4
gpt4 key购买 nike

我正在编写一个使用许多 ggplot2 的 R 包职能。问题是在 CRAN 测试期间,我有很多与 ggplot 相关的注释。功能(见下文)。鉴于这种情况,使用 ggplot2 的最佳方法是什么?在我的函数中以避免来自 CRAN 的这些注释?

我的代码示例:

s1 <- ggplot2::ggplot(result,aes(x=slope,y=..density..),
environment = environment())+
geom_histogram(fill="lightyellow",
alpha=.9,colour="grey60", size=.2) +
geom_density(size=.2) +
geom_vline(xintercept = slope.0,color="red",linetype=2,size=.7)+
xlab("Estimated slopes")+
theme(axis.text = element_text(size=14),
axis.title = element_text(size=16))

克兰笔记:

plot_influ_phylolm: no visible global function definition for ‘aes’
plot_influ_phylolm: no visible binding for global variable ‘slope’
plot_influ_phylolm: no visible binding for global variable ‘..density..’
plot_influ_phylolm: no visible global function definition for ‘geom_histogram’
plot_influ_phylolm: no visible global function definition for ‘geom_density’
plot_influ_phylolm: no visible global function definition for ‘geom_vline’ plot_influ_phylolm: no visible global function definition for ‘xlab’
plot_influ_phylolm: no visible global function definition for ‘theme’

最佳答案

您需要添加相关的Imports:DESCRIPTION , 和 importFrom(...)NAMESPACE .这个最近已经讨论了很多,例如参见 this thread on r-package-devel及其对进一步讨论的引用。

关于r - R 包中的 ggplot2 : Notes during CRAN tests,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31774258/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com