R/Utils.R

Defines functions Capitalize FormatURL IsValidReply

Capitalize <- function(x) {
    s <- strsplit(x, " ")[[1]]
    paste(toupper(substring(s, 1, 1)), substring(s, 2), sep = "", collapse = " ")
}

FormatURL <- function(paths, query) {
    pathstr <- paste(paths, collapse="/")
    querystr <- paste(names(query), query, sep="=", collapse="&")
    url <- paste(pathstr, querystr, sep="?")
    return (url)
}

IsValidReply <- function(reply) {
    return(is.element(reply, c("y", "n")))
}

Try the polidata package in your browser

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

polidata documentation built on May 2, 2019, 6:54 a.m.