filter_istat: Filter data sets

View source: R/filter_istat.R

filter_istatR Documentation

Filter data sets

Description

Filter data set by column(s). Takes as input a data.frame (not only ISTAT ones) and allows you to select for which column(s) value(s) to filter the dataset. Alternatively, use filter_istat_interactive for an interactive version.

Usage

filter_istat(dataset, columns, datatype, lang = "ita")

Arguments

dataset

as data.frame

columns

data set column(s) for which you want to filter the data. If you want to filter for more than one column, write c("column1","column2", ...) as argument.

datatype

column(s) value(s) for which you want to filter the data. Write as many datatype as many columns that you selected in "columns" (as in examples).

lang

language parameter for labels ("ita" for Italian, "eng" for English)

Value

It returns the filtered data set.

Examples

filter_istat(iris, columns = "Species", datatype = "setosa") #Here,
#the function filters the data set 'iris' for the value 'setosa' of the column 'Species'.
filter_istat(iris, columns = c("Species","Petal.Width"),
datatype = list(c("virginica","setosa"), c("0.1","1.9")))
# Here, the function filters the data set 'iris' for the values 'virginica'
#and 'setosa' of the column 'Species' and for the values '0.1' and '1.9' of
#the column 'Petal.Width'.

istat documentation built on Sept. 11, 2024, 7:17 p.m.