fingertipsR (version 0.1.3)

fingertips_data: Fingertips data

Description

Outputs a data frame of data from Fingertips

Usage

fingertips_data(IndicatorID = NULL, AreaCode = NULL, DomainID = NULL,
  ProfileID = NULL, AreaTypeID = 102, ParentAreaTypeID = NULL,
  categorytype = FALSE, inequalities, rank = FALSE,
  stringsAsFactors = default.stringsAsFactors())

Arguments

IndicatorID

Numeric vector, id of the indicator of interest

AreaCode

Character vector, ONS area code of area of interest

DomainID

Numeric vector, id of domains of interest

ProfileID

Numeric vector, id of profiles of interest. Indicator polarity can vary between profiles therefore if using one of the comparison fields it is recommended to complete this field as well as IndicatorID. If IndicatorID is populated, ProfileID can be ignored or must be the same length as IndicatorID (but can contain NAs).

AreaTypeID

Numeric vector, the Fingertips ID for the area type; default is 102

ParentAreaTypeID

Numeric vector, the comparator area type for the data extracted; if NULL the function will use the first record for the specified `AreaTypeID` from the area_types() function

categorytype

TRUE or FALSE, determines whether the final table includes categorytype data where it exists. Default to FALSE

inequalities

deprecated: TRUE or FALSE, same as categorytype

rank

TRUE or FALSE, the rank of the area compared to other areas for that combination of indicator, sex, age, categorytype and category along with the indicator's polarity. 1 is lowest NAs will be bottom and ties will return the average position. The total count of areas with a non-NA value are returned also in AreaValuesCount

stringsAsFactors

logical: should character vectors be converted to factors? The 'factory-fresh' default is TRUE, but this can be changed by setting options(stringsAsFactors = FALSE).

Value

A data frame of data extracted from the Fingertips API

Examples

Run this code
# NOT RUN {
# Returns data for the two selected domains at county and unitary authority geography
doms <- c(1000049,1938132983)
fingdata <- fingertips_data(DomainID = doms)#'

# Returns data at local authority district geography for the indicator with the id 22401
fingdata <- fingertips_data(22401, AreaTypeID = 101)

# Returns same indicator with different comparisons due to indicator polarity
# differences between profiles
# It is recommended to check the website to ensure consistency between your
# data extract here and the polarity required
fingdata <- fingertips_data(rep(90282,2), ProfileID = c(19,93), AreaCode = "E06000008")
fingdata <- fingdata[order(fingdata$TimeperiodSortable, fingdata$Sex),]
# }

Run the code above in your browser using DataLab