GSO is the General Statistics Office of Vietnam (GSO). The gso
package contains the updated (last update 03/2017), cleaned and tidy version of all the 316 tables available on the website. For the moment, only 113 data frames and 1 summary data frame are available within this package (more details in this vignette).
Installing the gso
package:
devtools::install_github("choisy/gso")
Loading and attaching the gso
package:
library(gso)
The package contains a data frame called content
containing for each row, a data frame (in the column data
) and some description of this data frame:
head(content)
The data frame contains different columns describing the data:
category
: global theme of the data frame. subcategory
: subcategory of the data frametime_range
: time range expressed in yeartime_resolution
: unit of time used in the data frame (year, month or single time point)sp_resoluation
: spatial unit used in the data frame (province, stations, city, rivers ...)data_frame
: name of the data frames on gsodata_name
: name of the data frames in the packageFor more details:
?content
You can used content
to select the data frame necessary for your study.
You can filter the data by the category, subcategory or others parameters to see the data available by different criterium:
agri_forest_fish <- subset(content, category == "Agriculture, Forestry and Fishery", data) agri_forest_fish <- agri_forest_fish$data[[1]] str(agri_forest_fish)
or, to select a data frame related to HIV in Vietnam
sel <- grep("hiv", content$data_frame, ignore.case = TRUE) content[sel, ] # permit to print more information df_hiv <- content[sel, "data"] df_hiv <- df_hiv$data[[1]] head(df_hiv)
Or you can also used the function View()
to print the data frame and explore all the data available, but the display can be quite long to open because of the column data
View(content)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.