R/location_fun.R

Defines functions location_fun

Documented in location_fun

#' Get athlete location
#'
#' Get athlete location, used internally in \code{\link{athl_fun}}
#' 
#' @param prsd parsed input list
#' 
#' @export
#' 
#' @concept notoken
#' 
#' @return A character string of the athlete location
location_fun <- function(prsd){
	
	out <- prsd %>% 
		rvest::html_elements(".Details_location__2Dwwo") %>% 
		xml2::xml_text()
	
	if(length(out) == 0) 
		out <- NA
	
	return(out)
	
}

Try the rStrava package in your browser

Any scripts or data that you put into this service are public.

rStrava documentation built on May 29, 2024, 12:35 p.m.