Examples
phibble
-
Read a CSV file into a typed table
Read nycflights13 weather from its URL, declare a factor, and see guessed types and missing values.
-
Query a database table
Summarize nycflights13 weather by airport in SQLite, inspect the query, and collect the result.
-
Analyze Eloquent models
Turn Eloquent queries and collections into data frames, then summarize and chart them.
phplyr
-
Filter rows and add columns
Keep the penguins with a recorded body mass, and add the mass in kilograms and a size label.
-
Summarize groups
Count the penguins and find the mean and largest body mass for each species, with some masses missing.
-
Join two tables
Add airport names and altitudes to hourly weather readings from the nycflights13 tables.
-
Pivot between wide and long
Count penguins per species with one column per study year, then stack the years into rows.
-
Translate an R script
Translate an R analysis that cleans, reshapes, and models data.
-
Analysis gallery
Short analyses that combine data pipelines with model fits.
phpolars
-
Aggregate with expressions
Summarize the Palmer penguins by species with several expressions in one grouped aggregation.
-
Query a large CSV file lazily
Count late departures from each New York City airport in the 33 MB nycflights13 flights file with a lazy query plan.
-
Rolling windows and as-of joins
Match JFK departures to the latest weather reading and a 3-hour rolling mean of temperature.
juphyter
-
Show a table and a chart in a notebook
Reads mtcars by URL in a JupyterLab notebook, summarizes fuel economy by cylinder count, and plots it against weight.
phit
-
Fit a linear model and predict
Estimate fuel economy from weight and cylinders in mtcars and predict new cars with intervals.
-
Fit logistic and Poisson models
Model labor-force participation in mroz and insurance claim rates with an exposure offset.
-
Fit a mixed model
Give each sleepstudy subject its own intercept and read how much subjects vary.
-
Densities, quantiles, and random draws
Evaluate the normal and Student's t distributions and draw reproducible samples.
-
Fit a mixed model to a Polars table and chart it
Read sleepstudy with Polars, fit subject intercepts, and chart one fitted line per subject.
-
Account for missing values
See how fits handle incomplete rows and report the rows they used.
phiz
-
Layer points and a fitted line
Adds a fitted line to a scatterplot and explains what its confidence band covers.
-
Compare groups with facets
Draws one panel per group and explains shared and free axis scales.
-
Save a chart to a file
Writes one chart as an interactive HTML page and as static SVG and PNG images.
-
Build a Livewire dashboard
Link several charts to the filters of one Livewire component.
-
Chart gallery
Browse charts by type, from distributions and heatmaps to linked brushing.
CmdStanPHP
-
Fit a Stan model with MCMC
Estimates the effect of SAT coaching in eight schools from Rubin's published data with a hierarchical model, and checks that the chains converged.
-
Bundled Stan models
Fit the example models that ship with CmdStanPHP.