Codefocus Example

Slide One

vector <- c(1,2,3)
vector <- sample(vector)
sum(vector)
[1] 6

When this fragment is shown, the first line of code will have the focus class added to it and it gets highlighted.

Another fragment. This time, both lines will now have the focus class.

And now both 1 and 3.

Slide two

a <- 1
b <- 2
c <- b + a

and,

print(c)
[1] 3

Here we have declared two variables

Then added them and passed them to c

Then print the c

Using normal highlights

You can still use normal higlights as well.

a <- 1
b <- 2
c <- 1 + 2

Test 1

Should be normal

df <- data.frame(x=1)
df
  x
1 1

Should be normal

df <- data.frame(x=1)

Test 2

Another slide