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) {
} else {
# Return Null if there is no birthdate
return(NULL)
# Return NA if there is no birthdate
return(NA)
}
}
......
......@@ -15,20 +15,20 @@
#' @examples
#' \dontrun{
#' articles <- get_data()
#'
#'
#' no.spouses <- get_no_of_spouses(articles$Text[54])
#'
#' no,spouses
#'
#' no.spouses
#' }
get_no_of_spouses <- function(article) {
# If there is no infobox we assume there were no spouses
if(!grepl("vcard", article)) {
return(0)
}
infoBox <- get_infobox(article)
# Get the spouse field
spouses <- infoBox[infoBox$Desc %like% "Spouse",]$Content
# 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