Package: dataprep 0.1.8

dataprep: Fast, Efficient, and Versatile Data Preprocessing and Reshaping with 'C++', 'OpenMP' & 'SIMD'

Fast, efficient, and versatile preprocessing and reshaping of tabular and time-series data. Most heavy routines are implemented in 'C++' via 'Rcpp', with optional 'OpenMP' parallelization and 'SIMD' acceleration ('AVX2' / 'AVX-512') on supported hardware. The 0.1.8 release rewrites the cleaning routines in 'C++' and delivers a 1.1–1146× speedup over 0.1.5. The 'melt()' and 'dcast()' reshaping functions achieve a 0.6×–1628.9× speedup for 'melt()' and a 1.9×–799.8× speedup for 'dcast()' relative to every one of the seven major alternatives in the R and Python ecosystems, at every tested scale (from 1,000 to 100,000,000 rows), and produce output identical to 'reshape2', 'data.table', 'tidyr', 'pandas', 'polars', 'dask', and 'duckdb'. Core preprocessing steps include variable deletion by missing fraction, observation deletion by consecutive missing runs, point-by-point weighted outlier removal via conditional extremum, traditional percentile-based outlier removal, and linear interpolation within short time periods. The package also provides fast reshaping, descriptive statistics, missing-value diagnosis, multiple imputation strategies, winsorization, several outlier detection methods (IQR, MAD, percentile), data transformation and standardization, categorical encoding, duplicate removal, data validation, data quality reporting, and stratified sampling. Feature-engineering helpers cover binning, high-correlation and low-variance filtering, and string cleaning. Time-series tools cover detrending, diurnal-cycle removal, rolling statistics, lag creation, resampling, simple decomposition, day/night and season flags, log returns, drift detection, and panel balancing. Fit/transform-style machine-learning interfaces prevent data leakage during preprocessing. Methods are based on, and improved from: Liang, C.-S., Wu, H., Li, H.-Y., Zhang, Q., Li, Z. & He, K.-B. (2020) <doi:10.1016/j.scitotenv.2020.140923>. This work was supported by the National Natural Science Foundation of China (No. 12301674).

Authors:Chun-Sheng Liang [aut, cre], Hao Wu [aut], Hai-Yan Li [aut], Qiang Zhang [aut], Zhanqing Li [aut], Ke-Bin He [aut]

dataprep_0.1.8.tar.gz
dataprep_0.1.8.zip(r-4.7-x86_64)dataprep_0.1.8.zip(r-4.7-arm64)dataprep_0.1.8.zip(r-4.6-x86_64)dataprep_0.1.8.zip(r-4.6-arm64)dataprep_0.1.8.zip(r-4.5-x86_64)
dataprep_0.1.8.tgz(r-4.6-x86_64)dataprep_0.1.8.tgz(r-4.6-arm64)dataprep_0.1.8.tgz(r-4.5-x86_64)dataprep_0.1.8.tgz(r-4.5-arm64)
dataprep_0.1.8.tar.gz(r-4.7-arm64)dataprep_0.1.8.tar.gz(r-4.7-x86_64)dataprep_0.1.8.tar.gz(r-4.6-arm64)dataprep_0.1.8.tar.gz(r-4.6-x86_64)
dataprep_0.1.8.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
dataprep/json (API)

# Install 'dataprep' in R:
install.packages('dataprep', repos = c('https://chunshengliang.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/chunshengliang/dataprep/issues

Pkgdown/docs site:https://chunshengliang.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:

On CRAN:

Conda:

accuracycompletenessconditional-extremumdata-filteringdata-reshapingefficientfastinterpolationlong-to-widemissing-value-imputationmissing-valuesobservationsoutlier-detectionoutlier-removalpoint-by-point-considerationshort-time-interval-groupingtime-intervalsvariablesversatilewide-to-longcppopenmp

4.85 score 1 stars 8 scripts 401 downloads 43 exports 18 dependencies

Last updated from:a38d35d1ae. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK214
linux-devel-x86_64OK183
source / vignettesOK365
linux-release-arm64OK182
linux-release-x86_64OK219
macos-release-arm64OK195
macos-release-x86_64OK305
macos-oldrel-arm64OK241
macos-oldrel-x86_64OK397
windows-devel-arm64OK429
windows-devel-x86_64OK258
windows-release-arm64OK416
windows-release-x86_64OK196
windows-oldrel-x86_64OK273
wasm-releaseOK172

Exports:balance_panelbin_dataclean_stringscondextrcreate_lagsdata_reportdataprepday_night_flagdcastdecompose_tsdeduplicatedescdatadescplotdetect_outliersdetrend_tsdrift_detectdry_runencode_categoricalfilter_high_corfilter_low_varimpute_missinglog_returnsmeltna_diagnoseobsedeleoptisolupercdatapercoutlpercplotphys_filterprep_fitprep_transformremove_diurnal_cycleresample_timeroll_applysample_dataseason_flagshorvalutransform_datavalidate_datavaridelewinsorizezerona

Dependencies:clicpp11farverggplot2gluegtableisobandlabelinglifecycleR6RColorBrewerRcpprlangS7scalesvctrsviridisLitewithr

dataprep: a leakage-free preprocessing workflow
The data-leakage problem | A minimal example | What is stored in the plan | A note on degenerate columns | Adding or removing steps | Column-order independence | Missing-column detection | Workflow with dataprep() | Reporting | Full applied workflow | When NOT to preprocess | Test environment | Where to go next | Session info

Last update: 2026-10-01
Started: 2026-09-26

dataprep: cleaning pipeline
Quick start | Overview | Why obsedele changed in 0.1.8 | Boundary behaviour | condextr vs percoutl | Why obsedele is re-applied after condextr | Step-by-step walkthrough | Step 1 — Variable deletion | Step 2 — Observation deletion | Before cleaning | Step 3 — Conditional extremum outlier removal | After cleaning | Step 4 — Short-period interpolation | One-call pipeline: dataprep() | Inspecting the plan without running it | Missing-value diagnostics | Additional cleaning helpers | When NOT to preprocess | Where to go next | Session info

Last update: 2026-10-01
Started: 2026-09-26

dataprep: descriptive statistics and diagnostic plots
Overview | Descriptive statistics | Line plot, numeric variable names | Selected statistics | Bar chart, character variable names | Control facet layout | Full-size data | The underlying table | Percentile plots | Full percentile range | Top percentiles only | Bottom percentiles only | Percentile curves of the raw data | Numeric axis control | Combining with ggplot2 | A diagnostic workflow | Where to go next | Session info

Last update: 2026-10-01
Started: 2026-09-26

dataprep: design philosophy and preprocessing methodology
The problem this package solves | The four-step pipeline | Variable deletion: three principles | 1. Signal-to-noise ratio as the primary threshold | 2. Physical relevance | 3. Missing-run length, not just missing fraction | Observation deletion: two principles | 1. Detect the pattern, don't filter the points | 2. The half-hour window is the physical mixing time | How it is implemented: anchor-based scan | Implementation evolution | Why "both sides" and not "one side"? | Subsets: group and period | Re-applied after outlier deletion | Outlier removal: two principles | 1. Per-point decisions, not one-shot thresholds | 2. Outlier deletion inherits the gap-length constraint | Missing-value interpolation: two principles | 1. Vertical, not horizontal | 2. Segment the series before interpolating | Why this order, and not any other | Evaluation metrics | Number of values deleted | Sample retention | Residual outliers | Newly created outliers | Uncertainty analysis | The package beyond the four steps | Related documentation | Funding | Session info

Last update: 2026-10-01
Started: 2026-09-26

dataprep: fast reshaping with melt() and dcast()
Why another reshape implementation | Test environment | Wide to long with melt() | Basic usage | Measure-side specification | Automatic ID inference | Custom column names and na.rm | Memory layout: major = "row" vs major = "col" | Thread control | Why melt() is fast | 1. Two layout paths, selected by major | 2. SIMD streaming stores | 3. Hugepage hint for large outputs | 4. Fast paths for small inputs | 5. Cache-aware block sizing | 6. Per-call caches for SEXP and factor levels | Long to wide with dcast() | Formula interface | Fill missing cells | Aggregating duplicate pairs | na.rm | Why dcast() is fast | 1. Block-path detection (Phase 0a–0c) | 2. 64-bit packed keys and 96-bit fingerprint fallback | 3. Radix sort for shuffle-friendly input | 4. Permutation shortcut | Where the gap is narrowest | Cross-engine consistency | melt consistency | dcast consistency | Round-trip example | Headline numbers | Ubuntu 25.10 | Windows 11 Pro for Workstations | Session info

Last update: 2026-10-01
Started: 2026-09-26

dataprep: performance and cross-engine consistency
Overview | Mean vs median | Test environment | How to read these numbers | Cleaning pipeline (dataprep 0.1.5 → 0.1.8) | melt() — wide to long | Vary rows, 1 id + 9 value columns | Vary rows, 10 id (5 int + 5 chr) | Vary value columns, 1e3 rows, 1 id | Vary value columns, 1e3 rows, 10 id | melt() on Windows 11 Pro for Workstations | dcast() — long to wide | Vary n_long, 1 id, 10 levels | Vary levels, 1 id, 1e6 rows | Vary n_long, 1 id, 100 levels | Vary n_id, 1e6 rows, 10 levels | dcast() on Windows 11 Pro for Workstations | Summary of speedups | Ubuntu 25.10 | Windows 11 Pro for Workstations | Cross-engine consistency | melt consistency | dcast consistency | Reproducing the benchmarks | Session info

Last update: 2026-10-01
Started: 2026-09-26

dataprep: upgrading from 0.1.5 to 0.1.8
What changed | Interface changes | Minimal reproduction of the boundary change | Minimal reproduction of the multi-column change | Implementation evolution | Quantified effect on a full-year dataset | Where the difference comes from | Migration checklist | What did not change | Performance reference | Test environments | Where to go next | Session info

Last update: 2026-10-01
Started: 2026-09-26

Readme and manuals

Help Manual

Help pageTopics
dataprep: Fast, Efficient, and Versatile Data Preprocessing and Reshaping with 'C++', 'OpenMP' & 'SIMD'dataprep-package
Balance panel databalance_panel
Discretize continuous variables into binsbin_data
Clean and standardize character columnsclean_strings
Remove outliers using point-by-point weighed outlier removal by conditional extremumcondextr
Create lagged variablescreate_lags
Example data (particle number concentrations in SMEAR I Varrio forest)data
Generate a simple data quality reportdata_report
Example data (aggregated particle number concentrations, SMEAR I Varrio forest)data1
Data preprocessing with multiple steps in one functiondataprep
Day/night flagday_night_flag
Cast a long-format data.frame into a wide formatdcast
Simple time series decompositiondecompose_ts
Remove duplicate observationsdeduplicate
Fast descriptive statisticsdescdata
View descriptive statistics via plotdescplot
Detect outliers using multiple methodsdetect_outliers
Remove linear trend from time seriesdetrend_ts
Sensor drift detectiondrift_detect
Simulate preprocessing and report changes without modifying datadry_run
Encode categorical variablesencode_categorical
Remove highly correlated variablesfilter_high_cor
Remove low-variance (near-constant) variablesfilter_low_var
Impute missing valuesimpute_missing
Logarithmic returns for financial time serieslog_returns
Fast wide-to-long data reshaping with flexible ID/measure specificationmelt
Diagnose missing value patterns in datana_diagnose
Delete observations with excessive consecutive missing valuesobsedele
Find optimal combination of interval and times for condextroptisolu
Calculate top and bottom percentiles of selected variablespercdata
Traditional percentile-based outlier removalpercoutl
Plot top and bottom percentiles of selected variablespercplot
Physical limit filteringphys_filter
Build a preprocessing plan on training data to prevent data leakageprep_fit
Apply a preprocessing plan to new dataprep_transform
Remove diurnal cycleremove_diurnal_cycle
Resample time series to a coarser periodresample_time
Apply rolling window statisticsroll_apply
Random sampling with optional stratificationsample_data
Season flagseason_flag
Interpolation with values to refer to within short periodsshorvalu
Transform and standardize numeric variablestransform_data
Validate data against a set of rulesvalidate_data
Delete variables containing too many missing valuesvaridele
Winsorize outliers by capping extreme valueswinsorize
Turn zeros to missing valueszerona