执行r studio - ggplot。直方图和密度图 [英] Execute r studio - ggplot. histogram and density plot
本文介绍了执行r studio - ggplot。直方图和密度图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是R和azure的新手,但是经过很长时间。 我有脚本工作,但当我点击视觉效果时没有图形。可以请你协助。
Im new to R and azure but after much time. I have the script working but there is not graphics when i click into visuals. Can you please assist.
推荐答案
Hello Wexclo,
Hello Wexclo,
您可以从R设备输出中检查可视化。
You can check the visualization from R device output.
我在执行R脚本模块中使用了以下脚本:
I used the following script in execute R script module:
dataset1 <- maml.mapInputPort(1) # class: data.frame
# Contents of optional Zip port are in ./src/
# source("src/yourfile.R");
# load("src/yourData.rdata");
library(ggplot2)
library(data.table)
names(dataset1) <- sub(pattern=',', replacement='.', x=names(dataset1))
foo = qplot(age, data = dataset1, geom = "histogram", fill = income, position = "dodge");
print(foo)
bar = qplot(age, data = dataset1, geom = "density", alpha = 1, fill = income);
print(bar)
foo = qplot(x=age, data=dataset1, geom="density", alpha=0.5, fill=income);
print(foo)
# Select data.frame to be sent to the output Dataset port
maml.mapOutputPort("dataset1");
运行模块后可视化的输出是:
The output of the visualization after running the module is:
我希望这会有所帮助!!
I hope this helps!!
这篇关于执行r studio - ggplot。直方图和密度图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文