Learn R Programming

istat (version 1.1.1)

filter_istat: 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")

Value

It returns the filtered data set.

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)

Examples

Run this code
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'.

Run the code above in your browser using DataLab