Every course we teach has logistics. The way we handle logistics has changed over time.
Logistics Techniques
Many old-time techniques are still good, but some of them are not well suited to teaching with computation and not well integrated with R.
Here are some basic areas needed for just about every R-based class.
These same areas apply to other software: JMP, Python, Matlab, Mathematica, etc.
Some Options:
Every student has a Facebook account, so they already have access to the hardware they need.
read.csv()
Give students links to data files on web server. Again, use the basic R functions, e.g.
read.csv("http://dl.dropboxusercontent.com/u/5098197/StatisticalModeling/mydata1.csv")
mosaic::fetchData()
data(Galton, package='mosaic')
Shared, editable files (e.g. for group projects)
and even …
Problems
Advantages
NONE
Of course, that’s how you would distribute files for download.
Rather than posting a link to the file, post the command for reading in the file to the current data session.
todaysData <- read.csv(file="http://dl.dropboxusercontent.com/u/5098197/StatisticalModeling/mydata1.csv")
Students cut-and-paste the command from course web site to their R session.
TIPS
Make sure the protocol is http://
, not https://
Use tinyurl.com` to translate your long URL to a short one.
fetchData("http://tinyurl.com/q9pbn7t")
## Complete file name given. No searching necessary.
## Who Age
## 1 Bill 3
## 2 Charley 4
## 3 Debby 5
Advantages
Set up a web repository for files. Write a function that looks up short names on that repository.
Example:
G <- mosaic::fetchData("Dome.csv")
## Retrieving from http://www.mosaic-web.org/go/datasets/Dome.csv
Advantages
Disadvantages
mosaic::fetchData()
doesn’t automatically connect to your repository, just the mosaic
one.Packages are the standard way for distributing R software. They also provide facilities for data, for notes, and for Rmd templates.
The data set you want to use may already exist in a CRAN or other package.
Command to access the data:
data(Galton)
or sometimes just Galton
data(BOD, package='datasets')
Finding the data you want:
Look at packages on CRAN etc. Get list by naming the package, e.g.
data(package='datasets')
There are thousands of datasets available.
It’s not hard to make a simple R package. Include your data in the data
directory of the package.
Example: * The sources https://github.com/dtkaplan/ECOTS-ICOTS-2014/tree/master/ECOTS/CourseR * Installation via
```r
require(devtools)
install_github("dtkaplan/ECOTS-ICOTS-2014/ECOTS/CourseR")
help(dataDocExample)
```
Use R/Markdown to write notes.
Options:
Suggestion: Use R Markdown and distribute the commands just like your class notes. Give a link to the .Rmd
file.
Have students copy and paste from their browser into the RStudio editor, and use “Chunks/Run All”. That will source the code.
RStudio has “templates.” These are currently distributed from packages.
From the CourseR
package.
Make it easy for instructors to set up the logistics.
Interested in helping?