fingertips_data: Fingertips data

Description Usage Arguments Details Value See Also Examples

View source: R/fingertips_data.R

Description

Outputs a data frame of data from Fingertips. Note, this function can take up to a few minutes to run (depending on internet connection speeds and parameter selection).

Usage

1
2
3
fingertips_data(IndicatorID = NULL, AreaCode = NULL, DomainID = NULL,
  ProfileID = NULL, AreaTypeID = 102, ParentAreaTypeID = NULL,
  categorytype = FALSE, rank = FALSE, path)

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 (Counties and Unitary Authorities)

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

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

path

String; Fingertips API address. Function will default to the correct address

Details

Note, polarity of an indicator is not automatically returned (eg, whether a low value is good, bad or neither). Use the rank field for this to be returned (though it adds a lot of time to the query)

Value

A data frame of data extracted from the Fingertips API

See Also

Other data extract functions: fingertips_redred

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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 (AreaTypeID = 101)
# 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 on the website
# 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),]
## End(Not run)

fingertipsR documentation built on March 7, 2019, 5:05 p.m.