X-Git-Url: https://code.communitydata.science/covid19.git/blobdiff_plain/a3e40a072f09f5faee5b12df27f313f75d087f3a:/keywords/analysis/translations_example.R..974dc48b12aed59fb5bf4ffdd41a6a00e5f5aa47:/keywords/example_analysis/static/gitweb.css diff --git a/keywords/analysis/translations_example.R b/keywords/analysis/translations_example.R deleted file mode 100644 index 0f0342c..0000000 --- a/keywords/analysis/translations_example.R +++ /dev/null @@ -1,17 +0,0 @@ -## example reading latest file straight from the server -df <- read.csv("https://covid19.communitydata.science/datasets/keywords/csv/latest.csv") - -## make the data more R-friendly -df$is.alt <- df$is_alt == "True" -df$is_alt <- NULL - -## find all translations for coronavirus -coronavirus.itemids <- df[ (tolower(df$label) == "coronavirus") & - (df$langcode == 'en') - ,"itemid"] - -## there are actually 5 item ids. The one referring to the family of virus is Q57751738 -coronavirus.translations <- df[df$itemid == "http://www.wikidata.org/entity/Q57751738",] - -## let's only look at non-aliases -print(coronavirus.translations[c(coronavirus.translations$is.alt == FALSE), c("label","langcode")])