Skip to content

Commit

Permalink
added @importFrom magrittr %>%
Browse files Browse the repository at this point in the history
  • Loading branch information
verajosemanuel committed May 6, 2019
1 parent 34dc188 commit 325bf44
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 222 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Collate:
'spanish.R'
RoxygenNote: 6.1.1
Suggests: testthat, tidyr
Depends: magrittr,xml2

1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
export(geocode_cadastral)
export(to_number)
export(to_words)
importFrom(magrittr,"%>%")
90 changes: 45 additions & 45 deletions R/cadastral_references-data.R
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
#' Cadastral references test data
#'
#' Randomly selected data from catastro to test geocode_cadastral function
#'
#' @docType data
#'
#' @usage data(cadastral_references)
#'
#' @format A data frame.
#'
#' @keywords datasets
#'
#' @references Catastro. Ministerio de Hacienda y función pública.
#' (\href{http://www.catastro.meh.es/}{Catastro})
#'
#' @source \href{http://www.catastro.meh.es/}{Sede Electrónica del Catastro}
#'
#' @examples
#' ## source is cadastral reference number ##
#'
#' geocode_cadastral("0636105UF3403N", parse_files = FALSE)
#'
#' ## Use lapply to geocode cadastral references from dataframe columns.
#'
#' cadastral_references$new <- lapply(cadastral_references$cadref1, geocode_cadastral)
#'
#' ## separate previously generated "new" data into columns usign tidyr
#'
#' library(tidyr)
#' separate(cadastral_references, new, into = c('longitude','latitude'), sep = "," )
#'
#' ## source is folder. A loop is needed to process each kml file ##
#'
#' \dontrun{
#' files <- list.files("folder", full.names = T)
#'
#' for (f in files) {
#' coords <- geocode_cadastral(f, parse_files = TRUE)
#' d <- as.data.frame(rbind(d , as.data.frame(coords, stringsAsFactors = F )))
#' }
#'
#'# separate lat/lon into columns if you prefer using tidyr
#' d <- tidyr::separate(coords, into = c("longitude","latitude"), sep = "," )
#'}
"cadastral_references"
#' Cadastral references test data
#'
#' Randomly selected data from catastro to test geocode_cadastral function
#'
#' @docType data
#'
#' @usage data(cadastral_references)
#'
#' @format A data frame.
#'
#' @keywords datasets
#'
#' @references Catastro. Ministerio de Hacienda y función pública.
#' (\href{http://www.catastro.meh.es/}{Catastro})
#'
#' @source \href{http://www.catastro.meh.es/}{Sede Electrónica del Catastro}
#'
#' @examples
#' \dontrun{
#' ## source is cadastral reference number ##
#'
#' geocode_cadastral("0636105UF3403N", parse_files = FALSE)
#'
#' ## Use lapply to geocode cadastral references from dataframe columns.
#'
#' cadastral_references$new <- lapply(cadastral_references$cadref1, geocode_cadastral)
#'
#' ## separate previously generated "new" data into columns usign tidyr
#'
#' library(tidyr)
#' separate(cadastral_references, new, into = c('longitude','latitude'), sep = "," )
#'
#' ## source is folder. A loop is needed to process each kml file ##
#'
#' files <- list.files("folder", full.names = T)
#'
#' for (f in files) {
#' coords <- geocode_cadastral(f, parse_files = TRUE)
#' d <- as.data.frame(rbind(d , as.data.frame(coords, stringsAsFactors = F )))
#' }
#'
#'# separate lat/lon into columns if you prefer using tidyr
#' d <- tidyr::separate(coords, into = c("longitude","latitude"), sep = "," )
#'}
"cadastral_references"
1 change: 1 addition & 0 deletions R/geocode_cadastral.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#' # d <- tidyr::separate(coords, into = c("longitude","latitude"), sep = "," )
#'}
#' @name geocode_cadastral
#' @importFrom magrittr %>%
#' @export


Expand Down
4 changes: 2 additions & 2 deletions R/to_number.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#' @examples
#' to_number("mil trescientos noventa y dos")
#'
#' Example table is provided: cantidades
#' # Example table is provided: cantidades
#' cantidades$var3 <- lapply(cantidades$var2, to_number)
#'
#' @name to_number
#' @keywords money, currency, euros, translate
#' @importFrom magrittr %>%
#' @export


Expand Down
1 change: 1 addition & 0 deletions R/to_words.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' @param x A valid integer amount.
#' @return A string for the same integer number in spanish.
#' @name to_words
#' @importFrom magrittr %>%
#' @export


Expand Down
Loading

0 comments on commit 325bf44

Please sign in to comment.