Learn R Programming

poliscidata (version 2.3.0)

sortC: Returns case-level information in order

Description

Returns case-level information in order specified by user.

Usage

sortC(data, id, by, descending = TRUE)

Arguments

data

Dataset to be sorted.

id

A variable in the dataset (data) that identfies individual cases, typically the name of states, countries, etc.

by

Variable the dataset should be sorted by.

descending

Should the cases be sorted in descending order? By default, set to TRUE.

Value

A data frame of sorted observations.

Examples

Run this code
# NOT RUN {
   library(poliscidata)
   
   sortC(data=states, id=state, by=abortlaw10)
   
   sortC(data=states, id=state, by=abortlaw10, descending=FALSE)
# }

Run the code above in your browser using DataLab