diff --git a/.Rhistory b/.Rhistory index 61c38cd..57f9de1 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,6 +1,3 @@ -build_vignettes() -build_vignettes() -library(regioncode) library(devtools) build_vignettes() library(regioncode) @@ -510,3 +507,6 @@ pkgdown::build_site() devtools::install(build_vignettes = TRUE) pkgdown::build_site() devtools::release() +devtools::install(build_vignettes = TRUE) +pkgdown::build_site() +devtools::release() diff --git a/.Rproj.user/shared/notebooks/paths b/.Rproj.user/shared/notebooks/paths index eba80f1..48de2c6 100644 --- a/.Rproj.user/shared/notebooks/paths +++ b/.Rproj.user/shared/notebooks/paths @@ -3,3 +3,4 @@ D:/Seafile/WW_research/01_Research/R_package/regioncode/NAMESPACE="96D5EBCA" D:/Seafile/WW_research/01_Research/R_package/regioncode/R/globals.R="56D29EEB" D:/Seafile/WW_research/01_Research/R_package/regioncode/R/regioncode.R="78A4CF23" D:/Seafile/WW_research/01_Research/R_package/regioncode/vignettes/regioncode-vignette.Rmd="48AAAEC1" +D:/Seafile/WW_research/01_Research/R_package/regioncode/vignettes/s_regioncode.bib="8CF3C239" diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 8a23420..dd9658a 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ Version: 0.1.2 -Date: 2024-03-07 11:43:57 UTC -SHA: 7a8ec67059d8e10826a81eb4e6dd69089ab80350 +Date: 2024-03-07 12:16:56 UTC +SHA: bedccceb0631d628c33a648816a66a3522265f22 diff --git a/dev/runBeforeRelease.R b/dev/runBeforeRelease.R index 3d22eeb..ec7e5cb 100644 --- a/dev/runBeforeRelease.R +++ b/dev/runBeforeRelease.R @@ -3,6 +3,7 @@ ## Vignette building devtools::install(build_vignettes = TRUE) +devtools::check(manual = TRUE) pkgdown::build_site() ## Spell checking diff --git a/regioncode.Rproj b/regioncode.Rproj index 1c89fbe..cb4ec19 100644 --- a/regioncode.Rproj +++ b/regioncode.Rproj @@ -20,4 +20,4 @@ PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source PackageBuildArgs: --resave-data PackageCheckArgs: --as-cran -PackageRoxygenize: rd,collate,namespace +PackageRoxygenize: rd,collate,namespace,vignette diff --git a/vignettes/regioncode-vignette.R b/vignettes/regioncode-vignette.R index 224aa98..442e717 100644 --- a/vignettes/regioncode-vignette.R +++ b/vignettes/regioncode-vignette.R @@ -3,7 +3,7 @@ knitr::opts_chunk$set(message = FALSE, warning = FALSE) if(!require(regioncode)) install.packages("regioncode") library(regioncode) -library(tidyverse) +library(dplyr) ## ----code2code---------------------------------------------------------------- library(regioncode) @@ -62,21 +62,22 @@ regioncode(data_input = corruption$prefecture, # Original full names corruption$prefecture -# Conversion to incomplete names in 1989 -fake_incomplete <- regioncode(data_input = corruption$prefecture, - convert_to = "name", - year_from = 2019, - year_to = 1989, - incomplete_name = "to") +fake_incomplete <- corruption$prefecture + +index_incomplete <- sample(seq(length(corruption$prefecture)), 7) + +fake_incomplete[index_incomplete] <- fake_incomplete[index_incomplete] |> + substr(start = 1, stop = 2) + fake_incomplete # Conversion to full names in 2008 -fake_full <- regioncode(data_input = fake_incomplete, +regioncode(data_input = fake_incomplete, convert_to = "name", - year_from = 1989, + year_from = 2019, year_to = 2008, - incomplete_name = "from") -fake_full + incomplete_name = TRUE) + ## ----municipality------------------------------------------------------------- names_municipality <- c("北京市", # Beijing, a municipality @@ -121,13 +122,6 @@ tibble( convert_to = "name", to_pinyin = TRUE ), - cityIncomplete = regioncode(data_input = corruption$prefecture, - year_from = 2019, - year_to = 1989, - convert_to = "name", - incomplete_name = "to", - to_pinyin = TRUE - ), areaPY = regioncode(data_input = corruption$prefecture, year_from = 2019, year_to = 1989, @@ -141,7 +135,7 @@ regioncode(data_input = c("山西", "陕西", "内蒙古", "香港", "澳门"), year_from = 2019, year_to = 2008, convert_to = "name", - incomplete_name = "both", + incomplete_name = TRUE, province = TRUE, to_pinyin = TRUE ) diff --git a/vignettes/regioncode-vignette.html b/vignettes/regioncode-vignette.html index edaad13..b2b159c 100644 --- a/vignettes/regioncode-vignette.html +++ b/vignettes/regioncode-vignette.html @@ -10,9 +10,9 @@ - + - +