문제

I am using RMySQL to retrieve a table from the server. The result has columns

id
CountryCode
date
Value

CountryCode can repeat itself n times.

What I would like to do is to get the total count of all CountryCodes and then plot the result.

I am new to R so I am not sure if this is done with a for or there is a simpler way to go through the data.frame to get this information.

I appreciate any tip in the right direction Thanks!

도움이 되었습니까?

해결책

Assuming these are in a dataframe named "dfrm":

ctbl <- table(dfrm$CountryCode)
plot(ctble)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top