سؤال

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