Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a csv which utilises only 1 column with data separated by a space. Called Uniq.csv

The numbers represents how many tweets the person has done, the name is that persons twitter name.

2 Bobby
1 Derek
1 John

I'm attempting to create a histogram from this data. Ideally each account name on the x axis and their tweet frequency on the y.

Here's my code at attempting this:

setwd(setwd("~/Documents")
UniqFreq <- read.csv("Uniq.csv",header = FALSE)
hist(UniqFreq)

Of course this isn't working. Any help or assistance would go along way!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
186 views
Welcome To Ask or Share your Answers For Others

1 Answer

This should get you started:

barplot(  x$V1, names.arg = x$V2 )

yields

enter image description here

Thr first agument is the vector with the values that are to be plotted and the second provides the x lables. There are many more screws for finetuning (titles, axis lables, colours ...) but that would go beyond the scope here I think.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...