Giter Site home page Giter Site logo

littlebooks's Introduction



Project MOSAIC Little Books

You can find PDFs of the Little Books here:

  • Start Teaching Statistics Using R [view] [download]

    This book presents instructors with an overview of our approach to teaching statistics with R and an introduction to our primary R toolkit.

  • A Student's Guide to R [view] [download]

    This book is organized by analysis method and demonstrates how to perform all of the statistical analyses typically covered in an Intro Stats course. It can serve a good reference for both students and faculty.

    This was formerly known as A Compendium of Commands to Teach Statistics With R but has been reworked to make it more student friendly.

  • Start R in Calculus [Amazon]

This book describes the use of R in calculus based on the successful redesign of the first semester calculus course at Macalester College.

There is a spanish language translation of the Student's Guide to R available at https://github.com/jarochoeltrocho/MOSAIC-LittleBooks-Spanish (kudos to Francisco Javier Jara Ávila, https://github.com/jarochoeltrocho)

littlebooks's People

Contributors

dtkaplan avatar mchien20 avatar nicholasjhorton avatar rpruim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

littlebooks's Issues

Facet Histogram in ggformula

I'm not sure how to facet histograms so that the histograms are vertically facetted. Using ggformula, I can only get the facets to be horizontal.
Thanks

review FrontMatter.Rnw for Teaching Statistics using R

There was a considerable amount of reference to instructors as the primary audience in the CommonMaterial/FrontMatter.Rnw. I made this more generic, which probably necessitates adding a section to StartTeaching with discussion of audience. Several parts commented out include:

%Nevertheless, those who are unfamiliar with \R\ or who have never used \R\ for teaching are understandably cautious about using it with students. If you are in that category, then this book is for you. Our goal is to reveal some of what we have learned teaching with \R\ and to make teaching statistics with \R\ as rewarding and easy as possible -- for both students and faculty. We will cover both technical aspects of \R\ and \RStudio\ (e.g., how do I get \R\ to do thus and such?) as well as some perspectives on how to use computation to teach statistics. The latter will be illustrated in \R\ but would be equally applicable with other statistical software.

%Others have used \R\ in their courses, but have perhaps left the course feeling
like there must have been better ways to do this or that topic. If that
sounds more like you, then this book is for you, too. As we have been working
on this book, we have also been developing the \pkg{mosaic}

Require more requires

Hi all, I was suggesting some MOSAIC resources to people and noticed that I got an error while doing this command in RStudio (in https://github.com/ProjectMOSAIC/LittleBooks/blob/master/Starting/EarlyRExamples.Rnw):

<<births1,out.width=".8\\textwidth",fig.width=5>>=
xyplot(births ~ dayofyear, data=Births78)
@

The reason is, of course, that I didn't load the mosaicData package like is done a few lines down. So I have two suggestions:

  • Naturally, make this (first) example work properly

  • More importantly, make it really clear why this is necessary there to the beginner - there is just a comment in the code itself! For instance, in the sentence

    The \dataframe{Births78} data set contains the number of births in the United States for each day of 1978.

it could be also explained how this works within R.

My apologies if this is in another issue - I didn't see it, anyway. And maybe you ask for it to be loaded earlier in the text? I didn't see it, though (granted, I was skimming); then again, people might start using such a book anywhere, n'est pas? Maybe every example should have the load or require, though that might be too tedious... Looking good!

review exercise to create a table (rbind and cbind)

On Jun 28, 2015, at 4:58 PM, Simon Halliday [email protected] wrote:

Nick,
OK. My bad! Thanks for the response. I think I got confused by it sounding like there was data, then seeing in the old doc that there had been. That said, rbind and cbind are only introduced in Ch. 5, so it might make sense to move the exercise to Ch. 5 if re-creating the table from vectors is only introduced then, rather than tallying with data as you do a lot of in Ch. 4.
Cheers & chat soon,
Simon

On Sun, Jun 28, 2015 at 4:43 PM, Nicholas Horton [email protected] wrote:
I believe that this is intended to be recreated using just the counts (not the original data). Something like this should do the trick:

foo <- rbind( a=c(w=5, x=8, y=10, z=2), b=c( 3,5,2,7) )
foo
w x y z
a 5 8 10 2
b 3 5 2 7

Randy, perhaps this item might be clarified (if it still exists)?

Nick

On Jun 28, 2015, at 3:39 PM, Simon Halliday [email protected] wrote:

Dear Nick & Randy,
I'm attending the CVC workshop in a few weeks and am trying to improve my R in anticipation of it. I've worked through the 5 College Guide and have also been working through the Mosaic 'Start Teaching with R' book. In 'Teaching' in Chapter 4 exercise 4.2 (p. 66) it references data to do with nightlight use, it but doesn't name the data. I tried searching for the data in the mosaic and mosaicData packages and couldn't find it, but then searched online to find out it was in an older version of the mosaic package (0.6-2) referenced here: http://www.inside-r.org/packages/cran/mosaic/docs/Nightlight. I haven't been able to find the data in the current versions of the packages (I have mosaic v. 0.10.9 installed via github & mosaicData v. 0.9.1-1).

I thought I'd better email in case anyone else tries working through the book with the new version of the package and struggles with that exercise.
Thanks so much & I look forward to the workshop.

Simon

Assistant Professor
Department of Economics
Smith College
107 Pierce Hall
21 West St, Northampton, MA
01063
413-585-3529

gf_fitdistr() errors

library(mosaic)
gf_dhistogram(~ cesd, data = filter(HELPrct, sex == "female"), binwidth = 7.1) %>%
gf_fitdistr(dist = dnorm)

Bug? Feature? New version issue? Thanks @rpruim for any guidance.

Warning messages:
1: In if (distname %in% c("dlnorm")) { :
the condition has length > 1 and only the first element will be used
2: In if (distname == "dnorm") { :
the condition has length > 1 and only the first element will be used
3: In if (distname == "poisson") { :
the condition has length > 1 and only the first element will be used
4: In if (distname == "dexp") { :
the condition has length > 1 and only the first element will be used
5: In if (distname == "dgeom") { :
the condition has length > 1 and only the first element will be used
6: Computation failed in stat_fitdistr():
EXPR must be a length 1 vector

sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] bindrcpp_0.2.2 mosaic_1.2.0 Matrix_1.2-14 mosaicData_0.16.0 ggformula_0.7.9002 ggplot2_2.2.1.9000
[7] lattice_0.20-35 dplyr_0.7.5

loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 pillar_1.2.3 compiler_3.5.0 plyr_1.8.4 bindr_0.1.1 tools_3.5.0
[7] tibble_1.4.2 gtable_0.2.0 nlme_3.1-137 pkgconfig_2.0.1 rlang_0.2.1 psych_1.8.4
[13] parallel_3.5.0 yaml_2.1.19 ggdendro_0.1-20 gridExtra_2.3 withr_2.1.2 stringr_1.3.1
[19] grid_3.5.0 tidyselect_0.2.4 mosaicCore_0.5.0 glue_1.2.0 R6_2.2.2 foreign_0.8-70
[25] reshape2_1.4.3 purrr_0.2.5 tidyr_0.8.1 magrittr_1.5 scales_0.5.0 MASS_7.3-50
[31] splines_3.5.0 mnormt_1.5-5 assertthat_0.2.0 colorspace_1.3-2 labeling_0.3 stringi_1.2.3
[37] lazyeval_0.2.1 munsell_0.5.0 broom_0.4.4

"Two Audiences" section in "A Student's Guide to R"

The "Two Audiences" subsection in the "About These Notes" section of "A Student's Guide to R" (p. 6) states that the primary audience is instructors. Is this accurate? Since I thought I was reading a student guide, I found this claim confusing.

gf_text issues

Is this a ggformula problem?

library(mosaic)
panel.labels <- function(x, y, labels = 'x',...) { panel.text(x, y, labels, cex = 0.4, ...)
}

gf_text(Murder ~ Assault, panel = panel.labels,
label = rownames(USArrests), data = USArrests, size = 2)

vcd causes trouble for mosaic

require(vcd)
Loading required package: vcd
Loading required package: grid

Attaching package: ‘vcd’

The following object is masked from ‘package:mosaic’:

mplot

Note that vcd is in setup.R!

I've added a "detach(package:vcd)" in TwoQuantitative.Rnw in the StudentGuide, but wanted to alert others.

Caveat emptor.

Improve README contents

This includes addressing #5, but also any additional links and/or text we would like to add. It's pretty minimal at the moment.

update to Student Guide (formerly Compendium)

I added a chapter introducing RStudio, as well as new examples of msummary(), derivedFactor(), and how to create a table from summary statistics. Comments and suggestions welcomed.

OneQuantitative Questions

  1. Normal curve looks weird, not sure if there is a function for a normal curve
  2. Normal curve looks weird.
  3. Dot plot looks strange--might be because I can't get bins to work, so I used binwidth
  • also, I can't find 'female' as a data set, not sure if it was filtered and stored somewhere, so I continued to use the filter function for every use.
  1. I don't know how to find these functions in ggformula
  2. xpnorm gives me a curve that looks like ggplot. Do I need to change this?

Delete Simulation? Recommit to it?

The last commit is from over 2 years ago and labeled "toward a first clean compile", so this never was quite ready. But perhaps it is worth reviving -- have to look at see. I think this has Danny's Planet Null analogy in it, for example, and removed of the constraints of the Lock bake-off questions, we can organize this differently from the Resampling vignette.

For now, we have the Resampling vignette in the mosaic package.

Pre-printing run-through of Start Teaching

p. 31 groups = wday throws an error, since wday is not a variable in Births78. Do we want to say
lubridate::wday(date)

Same problem with wday on pp. 53, 55

I have fixed these provisionally by using
groups=lubridate::wday(date, label=TRUE)

Pagination was improved to avoid long blank vertical gaps. See \enlargethispage{1in}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.