简体   繁体   English

Barplots无法正确绘制R中的频率

[英]Barplots Not Plotting Frequency Correctly in R

Struggling to plot a barplot where the height of each bar is related to the value in a column (in this case, freq). 努力绘制条形图,其中每个条形的高度与一列中的值相关(在本例中为freq)。 Table name is Tag_Count_2 表名称是Tag_Count_2

Tag.1  freq
Hello  3
My     4
Name   10

I tried: 我试过了:

Counts<-table(Tag_Count_2$freq)
barplot(Counts)

But it plots the # of times values under Tag.1 share the same freq. 但是,它绘制了Tag.1下共享相同频率的时间#值。 I also tried: 我也尝试过:

barplot(Tag_Count_2, height=freq)

But it said freq wasn't found. 但是它说没有找到频率。

Are you looking for 你在找吗

barplot(Tag_Count_2$freq)

You don't need the table command in this case as you already have the frequency . 在这种情况下,您不需要table命令,因为您已经有了频率。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM