Basic concepts
- Create a numeric vector
x with five values and compute its mean and standard deviation using base R.
- Create a character vector
id and a logical vector passed each of four elements. Combine them into a data.frame and inspect with str().
- Use
names() to assign column names to a data frame you created and verify with names(dat).
- Create a
q_1, q_2, q_3 up to q_25 two times with paste() and with paste0().
- Compute the square root of 2, the exponential of 1, and the natural logarithm of 10.
- Create a
list with three heterogeneous elements (numeric, character, logical). Access elements by name and by position.
- Use
factor() to create a factor with levels A and B. Show the internal integer representation with as.numeric().
- Add comment lines to three of the previous tasks. Use
# for each line.
- Add three section headers to your R script using
# ---- separators that help to organise your text.
- Open the help page for
rank with ?rank and summarize what it does.