Description Usage Arguments Details Value Author(s) Examples
View source: R/ByCountryData.R
Function to extract county data
1 | ByCountryData(alldat = covid19)
|
alldat |
input data |
Okay
list
E. A. Pena
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (alldat = covid19)
{
uniqueCode = unique(alldat$countryterritoryCode)
uniqueID = unique(alldat$geoID)
uniqueCountry = unique(alldat$countriesAndTerritories)
lenCode = length(uniqueCode)
Country_Data = vector("list", lenCode)
n = 0
for (uc in uniqueCode) {
n = n + 1
countrydat = alldat[alldat$countryterritoryCode == uc,
]
temp = ConvertToList(countrydat)
Country_Data[[n]] = temp
}
return(list(CountryCode = uniqueCode, CountryID = uniqueID,
Country = uniqueCountry, Country_Data = Country_Data))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.