These classes are used to define callback behaviors that have been adapted for use on IPUMS microdata extracts. Though the callbacks from the readr package will work, they will not handle implicit decimals or add value/variable labels to the data.
hipread::ChunkCallback
-> hipread::HipChunkCallback
-> IpumsChunkCallback
set_ipums_fields()
IpumsChunkCallback$set_ipums_fields(
data_structure,
ddi,
var_attrs,
rt_ddi = NULL
)
clone()
The objects of this class are cloneable with this method.
IpumsChunkCallback$clone(deep = FALSE)
deep
Whether to make a deep clone.
hipread::ChunkCallback
-> hipread::HipChunkCallback
-> ipumsr::IpumsChunkCallback
-> IpumsSideEffectCallback
new()
IpumsSideEffectCallback$new(callback)
receive()
IpumsSideEffectCallback$receive(data, index)
continue()
IpumsSideEffectCallback$continue()
clone()
The objects of this class are cloneable with this method.
IpumsSideEffectCallback$clone(deep = FALSE)
deep
Whether to make a deep clone.
hipread::ChunkCallback
-> hipread::HipChunkCallback
-> ipumsr::IpumsChunkCallback
-> IpumsDataFrameCallback
new()
IpumsDataFrameCallback$new(callback)
receive()
IpumsDataFrameCallback$receive(data, index)
result()
IpumsDataFrameCallback$result()
finally()
IpumsDataFrameCallback$finally()
clone()
The objects of this class are cloneable with this method.
IpumsDataFrameCallback$clone(deep = FALSE)
deep
Whether to make a deep clone.
hipread::ChunkCallback
-> hipread::HipChunkCallback
-> ipumsr::IpumsChunkCallback
-> IpumsListCallback
new()
IpumsListCallback$new(callback)
receive()
IpumsListCallback$receive(data, index)
result()
IpumsListCallback$result()
finally()
IpumsListCallback$finally()
clone()
The objects of this class are cloneable with this method.
IpumsListCallback$clone(deep = FALSE)
deep
Whether to make a deep clone.
hipread::ChunkCallback
-> hipread::HipChunkCallback
-> ipumsr::IpumsChunkCallback
-> IpumsBiglmCallback
new()
IpumsBiglmCallback$new(model, prep = function(x, pos) x, ...)
receive()
IpumsBiglmCallback$receive(data, index)
result()
IpumsBiglmCallback$result()
clone()
The objects of this class are cloneable with this method.
IpumsBiglmCallback$clone(deep = FALSE)
deep
Whether to make a deep clone.
Callback function that is used only for side effects, no results are returned.
Initialize with a function that takes 2 arguments x (which will be the data chunk)
and an integer that indicates the position of the first observation in the chunk.
If the function returns FALSE
, no more chunks will be read.
Callback function that combines each result together into a data.frame at the end. Initialize the same was as IpumsSideEffectCallback, and the results from the function will be fed into a data.frame.
Callback function that returns a list, where each item is the result from a chunk. Initalize the same was as IpumsSideEffectCallback.
Callback function that performs a regression on the full dataset, one chunk
at a time using the biglm package. Initialize with arguments model
(A
formula of your model and prep
a function like the other callback arguments
that prepares the data before running the regression. Other arguments are
passed to biglm.
(Only needed for advanced usage) Callback interface definition, all
callback functions for IPUMS data should inherit from this class, and should
use private method ipumsify
on the data to handle implicit decimals
and value labels.