我希望只绘制落在频段内的测量百分比.我将它们分为低中和高中.但是当我绘制它们时,它将代表性地显示不显示值(参见图像,例如输出)
代码如下
percents <- data.frame(TI = c("Low","Med","High"),
percent = c(format((totallowcount/totalvaluescount)*100,digits=3),
format((totalmedcount/totalvaluescount)*100,digits=3),
format((totalhighcount/totalvaluescount)*100,digits=3)))
TIbarplot <- ggplot(data = percents, aes(x = TI, y = percent)) +
geom_bar(stat = 'identity') +
scale_x_discrete(limits = c("Low","Med","High"))
Run Code Online (Sandbox Code Playgroud)
我查看了做scale_y_discrete,scale_y_discrete(limits=c(0,25,50,100))但一直在为它获取错误.
Error in matrix(value, n, p) :
'data' must be of a vector type, was 'NULL'
In addition: Warning message:
Removed 3 rows containing missing values
(position_stack).
我希望我的用户能够按照自己的意愿保存文件.我正在编写的这个程序将被许多不同的人用于数百个文件.我希望这是可能的
filename = input("Enter Desired File Name:")
F = open(filename,'wb')
Run Code Online (Sandbox Code Playgroud)
作为试运行,我运行它并输入名称Hello_Buddy.csv并收到此错误.
Traceback (most recent call last):
File "C:\Users\Bud\Desktop\School\Project Data\OWLeS\Radiosonde
Data\Python\Simple\Moving Average.py", line 44, in <module>
filename = input("Enter Desired File Name:")
File "<string>", line 2, in <module>
NameError: name 'Hello_Buddy' is not defined
Run Code Online (Sandbox Code Playgroud)