Skip to content
Snippets Groups Projects
Commit d402c31e authored by David Fuhry's avatar David Fuhry :fist:
Browse files

Merge branch 'master' into '46-enhancing-r-optimize-getbirthplace-r'

# Conflicts:
#   processing/wikiproc/R/get_birthplace.R
parents 9daf7047 79e281db
No related branches found
No related tags found
1 merge request!44Adds use of annotations to get_birthplace.R.
...@@ -43,8 +43,8 @@ get_birthdate <- function(article) { ...@@ -43,8 +43,8 @@ get_birthdate <- function(article) {
} else { } else {
# Return Null if there is no birthdate # Return NA if there is no birthdate
return(NULL) return(NA)
} }
} }
......
...@@ -15,20 +15,20 @@ ...@@ -15,20 +15,20 @@
#' @examples #' @examples
#' \dontrun{ #' \dontrun{
#' articles <- get_data() #' articles <- get_data()
#' #'
#' no.spouses <- get_no_of_spouses(articles$Text[54]) #' no.spouses <- get_no_of_spouses(articles$Text[54])
#' #'
#' no,spouses #' no.spouses
#' } #' }
get_no_of_spouses <- function(article) { get_no_of_spouses <- function(article) {
# If there is no infobox we assume there were no spouses # If there is no infobox we assume there were no spouses
if(!grepl("vcard", article)) { if(!grepl("vcard", article)) {
return(0) return(0)
} }
infoBox <- get_infobox(article) infoBox <- get_infobox(article)
# Get the spouse field # Get the spouse field
spouses <- infoBox[infoBox$Desc %like% "Spouse",]$Content spouses <- infoBox[infoBox$Desc %like% "Spouse",]$Content
# Remove everything in parentheses # Remove everything in parentheses
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment