终极指南:为VSCode添加专业级毛玻璃透明效果的最佳实践
2026/8/6 23:55:50
在R语言中,我们可以进行各种统计计算和数据可视化操作。以下是一些基本的数据生成和绘图示例。
# generate data x <- 1:30 y <- rnorm(30, mean = x) y2 <- rnorm(30, mean = x, sd = sqrt(x))上述代码中,我们生成了两个数据集y和y2,它们都与x相关,但y2的标准差是sqrt(x)。
# plot y against x plot(y ~ x) # alternatively plot(x, y)这两种方式都可以绘制y与x的散点图。
# using lines instead of points plot(x, y, type = "l") # using both plot