Question

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!

Was it helpful?

Solution

Assuming these are in a dataframe named "dfrm":

ctbl <- table(dfrm$CountryCode)
plot(ctble)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top