Learn R Programming

sc2sc (version 0.0.1-18)

sc2cp: Implements the geometric spatial transfer of statistics from Spanish census sections to postal code areas

Description

Transfers the statistics available in a set of Spanish census sections from a given year to the corresponding spatial set of Spanish official postal code areas.

Usage

sc2cp(x, year, data.type = "counts", all.units = FALSE, na.rm = TRUE, ...)

Value

A list with the following components

df

A data frame with the statistics spatially transferred to the postal code areas.

missing

A vector with the codes of the census sections included in x that are not available in the shp file of census sections corresponding to the year.sscc.origin division.

Arguments

x

A data frame of order N x K (with K > 1) with the statistics to be spatially transferred/imputed. The first column must contains the code of the census section to which the statistics belong to. The statistical nature of the data columns must be of the same type. See the argument data.type.

year

An integer number. Reference year of the census sections included in the first column of x. Only 2001 and 2003 to 2025 are allowed.

data.type

A character string indicating the type of data to be transferred, either "counts" (aggregate statistics) or "averages" (mean, proportion or rate statistics). Default "counts".

all.units

A TRUE/FALSE logical value indicating the postal code area division to be included in the output data frame. If TRUE all the postal code areas are included. If FALSE only those units for which a value is imputed are included. Default, FALSE.

na.rm

A TRUE/FALSE logical value indicating whether NA values should be stripped before the computations proceed. Default, TRUE.

...

Other arguments to be passed to the function. Not currently used.

Author

Jose M. Pavia, pavia@uv.es

Virgilio Perez virgilio.perez@uv.es

References

Goerlich, FJ (2022). Elaboracion de un mapa de codigos postales de Espana con recursos libres. Como evitar pagar a Correos 6000 euros por informacion de referencia. Working Papers Ivie n. 2022-3. Valencia: Ivie. tools:::Rd_expr_doi("10.12842/WPIVIE_0322")

Pavia, JM and Cantarino, I (2017a). Can dasymetric mapping significantly improve population data reallocation in a dense urban area? Geographical Analysis, 49(2), 155-174. tools:::Rd_expr_doi("10.1111/gean.12112")

Pavia, JM and Cantarino, I (2017b). Dasymetric distribution of votes in a dense city. Applied Geography, 86, 22-31. tools:::Rd_expr_doi("10.1016/j.apgeog.2017.06.021")

Perez, V and Pavia, JM (2024a). Improving Accuracy in Geospatial Information Transfer: A Population Density-Based Approach, in 6th International Conference on Advanced Research Methods and Analytics (CARMA 2024), Editorial Universitat Politecnica de Valencia, pp. 326-333. tools:::Rd_expr_doi("10.4995/CARMA2024.2024.17796")

Perez, V and Pavia, JM (2024b) Automating the transfer of data between census sections and postal codes areas over time. An application to Spain. Investigaciones Regionales - Journal of Regional Research, forthcoming. tools:::Rd_expr_doi("10.38191/iirr-jorr.24.057")

See Also

sc2cp cp2sc

Examples

Run this code
data <- structure(list(SSCC = c(0103701001, 4619401008, 4603103003),
                       pop = c(12000L, 14000L, 11000L)),
                       class = "data.frame", row.names = c(NA, -3L))
example <- sc2cp(x = data, year = 2012, data.type = "counts")

Run the code above in your browser using DataLab