1  Basic features

Hyperlinks connect content both within and external to the book material (for example, citations; See Knuth (1984) for an early discussion of literate programming [the underlying philosophy driving this authoring platform]). Or, see Chapter 2 for a demonstration of image and figure capabilities.

1.1 Code

The preferred statistical language represents a common area of frustration for Psychometrics students. This authoring platform offers several features intended to facilitate learning of the underlying language (R).

The code represented in Listing 1.1 (and all example pieces of code) can be copied by activating the clipboard option in the upper-right hand corner of the code chunk.

Tip

R code can always be copied onto your personal computer via the clipboard icon: .

Listing 1.1: Addition within R
1 + 1                                    

For more complex bits of code, hidden annotations are available (the student can access further assistance by hovering over the circled numbers):

library(psych)
data(bfi)

bfi$jibberish <- rowMeans(bfi[1:10], na.rm=TRUE)
bfi$gobbleyjook <- rowMeans(bfi[11:20], na.rm=TRUE)
1
The psych package contains example data that we can access.
2
This gives us access to the bfi dataset that contains personality item responses.
3
We make 2 scale scores, jibberish and gobbleyjook. The $ notation indicates that these scale scores will be appended to the bfi dataframe.

The entire code block can also be hidden unless asked-for1. These features permit students of different knowledge and confidence levels to access help on an as-needed basis:

Code
library(psych)
data(bfi)

bfi$jibberish <- rowMeans(bfi[1:10], na.rm=TRUE)
bfi$gobbleyjook <- rowMeans(bfi[11:20], na.rm=TRUE)
1
The psych package contains example data that we can access.
2
This gives us access to the bfi dataset that contains personality item responses.
3
We make 2 scale scores, jibberish and gobbleyjook. The $ notation indicates that these scale scores will be appended to the bfi dataframe.

  1. In html format only.↩︎