Learn R Programming

⚠️There's a newer version (1.9.1) of this package.Take me there.


Purpose and design

The mosaic package is designed to facilitate the use of R in statistics and calculus instruction by providing a number of functions that (a) make many common tasks fit into a common template, and (b) simplify some tasks that would otherwise be too complicated for beginners.

Installation

You install from CRAN using

install.packages("mosaic")

or from github with

devtools::install_github("ProjectMOSAIC/mosaic")

If you want to try out our developmental code (the beta branch), use

devtools::install_github("ProjectMOSAIC/mosaic", ref="beta")

Updates to the master github repository are more frequent than CRAN updates. Our beta branch is where we implement bug fixes most quickly and develop new features. We try to keep it pretty stable, but there may be a few rough edges, missing documentation, etc. while things are in progress.

If you discover a problem with any version of the package, be sure to let us know so that we can address it. Post an issue on github or send email to Rpkgs@mosaic-web.org.

Getting Started with mosaic

The package includes several vignettes to help you get started. One of these vignettes (Resources Related to the mosaic package) includes a list of many resources, both within the package and external to it. That's a good place to start.

Getting Help

Need help? Try posting a question on Stack Overflow using the tag r-mosaic.

Project MOSAIC

Project MOSAIC is a community of educators working to develop a new way to introduce mathematics, statistics, computation and modeling to students in colleges and universities.

Our goal: Provide a broader approach to quantitative studies that provides better support for work in science and technology. The focus of the project is to tie together better diverse aspects of quantitative work that students in science, technology, and engineering will need in their professional lives, but which are today usually taught in isolation, if at all.

  • Modeling. The ability to create, manipulate and investigate useful and informative mathematical representations of a real-world situations.
  • Statistics. The analysis of variability that draws on our ability to quantify uncertainty and to draw logical inferences from observations and experiment.
  • Computation. The capacity to think algorithmically, to manage data on large scales, to visualize and interact with models, and to automate tasks for efficiency, accuracy, and reproducibility.
  • Calculus. The traditional mathematical entry point for college and university students and a subject that still has the potential to provide important insights to today's students.

The name MOSAIC reflects the first letters --- M, S, C, C --- of these important components of a quantitative education. Project MOSAIC is motivated by a vision of quantitative education as a mosaic where the basic materials come together to form a complete and compelling picture.

Find out more about Project MOSAIC at [http://mosaic-web.org].

Copy Link

Version

Install

install.packages('mosaic')

Monthly Downloads

14,995

Version

1.1.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Randall Pruim

Last Published

November 28th, 2017

Functions in mosaic (1.1.1)

TukeyHSD.lm

Additional interfaces to TukeyHSD
adapt_seq

Adaptively generate sequences in an interval
MAD

All pairs mean and sum of absolute differences
aggregatingFunction1

1-ary Aggregating functions
CIsim

Compute confidence intervals from (multiple) simulated data sets
aggregatingFunction1or2

1- or 2-ary aggregating functions
FunctionsFromData

Create function from data
ashplot

Average Shifted Histograms
binom.test

Exact Tests for Proportions
bargraph

Create bar graphs from raw data
cdist

Central portion of a distribution
compareProportion

Compare proportions between 2 groups
cull_for_do

Cull objects used with do()
confint

Confidence interval methods for output of resampling
Broyden

Multi-Dimensional Root Finding
fetchData

Defunct functions now in the fetch package
CIAdata

Return a dataset based on the CIA World Factbook
diffmean

Difference in means and proportions
do

Do Things Repeatedly
chisq

Extract Chi-squared statistic
fortify.hclust

mosaic tools for clustering
columns

return a vector of row or column indices
compareMean

Compare means between 2 groups
cor_test.formula

Alternative formula interface for cor.test
cross

Factor cross products
docFile

Return the path to a documentation file in a package
dpqrdist

Distribution wrapper
dotPlot

Dotplots
derivedVariable

Create new variables from logicals
freqpoly

Turn histograms into frequency polygons
dfapply

apply-type function for data frames
fav_stats

Some favorite statistical summaries
mean_

Aggregating functions
ediff

Lagged Differences with equal length
findZerosMult

Find the zeros of a function of two or more variables
maggregate

Aggregate for mosaic
fitModel

Fit a nonlinear least squares model
aggregatingFunction2

2-ary aggregating functions
ladd

Add to Lattice Plots
makeMap

Make a map with ggplot2
freqpolygon

Frequency Polygons
.is.formula

Check if formula
mosaic-package

mosaic: the Project MOSAIC package
is.wholenumber

Check for whole number values
findZeros

Find zeros of functions
joinFrames

Join data frames
inspect

Inspect objects
makeColorscheme

Create a color generating function from a vector of colors
confint.htest

Extract summary statistics
pdist

Illustrated probability calculations from distributions
expandFun

Expand the left-hand side of a formula
perctable

Cross tabulation displayed as percents or proportions
factorize

Conditionally convert vectors to factors
reexports

Objects exported from other packages
relm

Resample a Linear Model
gwm

Groupwise Models (Defunct)
mid

midpoints along a sequence
inferArgs

Infer arguments
mm

Defunct modeling function
ntiles

Create vector based on roughly equally sized groups
linear.algebra

Functions for teaching linear algebra.
rescale

Rescale
logical2factor

Turn logicals into factors; leave other things alone
rflip

Tossing Coins
print.msummary.lm

Modified summaries
standardName

Standardization of Geographic Names
statTally

Tally test statistics
n_missing

counting missing elements
orrr

Odds Ratio and Relative Risk for 2 x 2 Contingency Tables
as.xtabs

Convert objects to xtabs format
plotPoints

Scatter plot of points
qdata

The Data Distribution
deg2rad

Convert between degrees and radians
rand

Random Regressors
deltaMethod

deltaMethod has moved to a separate package
read.file

Read data files
evalFormula

Evaluate a formula
rsquared

Extract r-squared value
evalSubFormula

Evaluate a part of a formula
getVarFormula

Extract data from a data frame using a formula interface
googleMap

Display a point on earth on a Google Map
fitSpline

Fit splines to data
logit

Logit and inverse logit functions
fortify.summary.lm

Extract data from R objects
MAD_

All pairs mean and sum of absolute differences
rstudio_is_available

Check whether RStudio is in use
xyz2latlon

Convert back and forth between latitude/longitude and XYZ-space
set.rseed

Set seed in parallel compatible way
mUSMap

Make a US map with ggplot2
sp2df

Transforms a shapefile into a dataframe
panel.plotFun

Panel function for plotting functions
mWorldMap

Make a world map with ggplot2
panel.plotFun1

Panel function for plotting functions
panel.levelcontourplot

Lattice plot that draws a filled contour plot
qdist

Illustrated quantile calculations from distributions
panel.lmbands

show confidence and prediction bands on plots
mPlot

Interactive plotting
mosaic.options

Setting options for mosaic package functions
plotFun

Plotting mathematical expressions
mplot

Generic plotting
plotModel

Plot a regression model
project

Projections
repeater-class

Repeater objects
qdata_v

The Data Distribution
resample

More Random Samples
plotCumfreq

Cumulative frequency plots
tally

Tabulate categorical data
plotDist

Plots of Discrete and Continuous Distributions
prop.test

Exact and Approximate Tests for Proportions
rfun

Generate a natural-looking function
prop

Compute proportions, percents, or counts for a single level
rgeo-internals

rgeo internal functions
theme_map

ggplot2 theme for maps
theme.mosaic

Lattice Theme
xchisq.test

Augmented Chi-squared test
r.squared

Extract r-squared value
rlatlon

Sample longitude and latitude on a sphere
xhistogram

Augmented histograms
rspin

Simulate spinning a spinner
xpnorm

Augmented versions of pnorm and qnorm
surround

Format strings for pretty output
xqqmath

Augmented version of qqmath
swap

Swap values among columns of a data frame
t_test

Student's t-Test
zscore

Compute z-scores
update_ci

Update confidence interval
value

Extract value from an object