Skip to content

Commit

Permalink
error still
Browse files Browse the repository at this point in the history
  • Loading branch information
sammo3182 committed Mar 8, 2024
1 parent bedccce commit 395c624
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 105 deletions.
6 changes: 3 additions & 3 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
build_vignettes()
build_vignettes()
library(regioncode)
library(devtools)
build_vignettes()
library(regioncode)
Expand Down Expand Up @@ -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()
1 change: 1 addition & 0 deletions .Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions dev/runBeforeRelease.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Vignette building

devtools::install(build_vignettes = TRUE)
devtools::check(manual = TRUE)
pkgdown::build_site()

## Spell checking
Expand Down
2 changes: 1 addition & 1 deletion regioncode.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 13 additions & 19 deletions vignettes/regioncode-vignette.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
)
Expand Down
143 changes: 68 additions & 75 deletions vignettes/regioncode-vignette.html

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions vignettes/s_regioncode.bib
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ @misc{GuoJiaTongJiJu2022
title = {关于更新全国统计用区划代码和城乡划分代码的公告},
author = {{国家统计局}},
date = {2022},
url = {http://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/2022/index.html},
urldate = {2023-08-20},
langid = {chinese},
organization = {{中华人民共和国国家统计局}},
file = {D:\zotero_system\storage\3YF3PPKK\index.html}
organization = {{中华人民共和国国家统计局}}
}
@book{GuoJiaTongJiJu2022a,
Expand Down Expand Up @@ -46,7 +44,6 @@ @misc{MinZhengBu2022
title = {2021年中华人民共和国行政区划代码},
author = {{民政部}},
date = {2022},
url = {https://www.mca.gov.cn/n156/n186/c110745/content.html},
urldate = {2023-08-20},
langid = {chinese},
organization = {{中华人民共和国民政部}},
Expand All @@ -59,7 +56,6 @@ @article{SunPing2020
author = {{孙平}},
date = {2020-12-14},
journaltitle = {中国社会报},
url = {https://www.mca.gov.cn/n152/n166/c41451/content.html},
urldate = {2023-08-20},
langid = {chinese},
file = {D:\zotero_system\storage\7Y2BQQQB\content.html}
Expand Down

0 comments on commit 395c624

Please sign in to comment.