boolean_vec <- c(TRUE, TRUE, FALSE) # boolean
numeric_vec <- c(3, 2, 6) # numeric
c(boolean_vec, numeric_vec)
[1] 1 1 0 3 2 6
[1] "numeric"
0
and 1
many functions proceed element by element
nothing gets recycled with equally long vectors
The second vector contains just one value and that must serve each element of the first vector
2
gets recycled
the second vector gets recycled once
each of its element must serve twice
R believes you want it this way
Feed this function with 2 or 3 vectors you create in your own script.
Experiment with the numbers of their elements to get a feel for recycling.
?sort
The function expects the arguments in the defined order.
If you keep this order, you can just type their values.
Study functions under list.files
.
Check that your working directory is your home.
getwd()
setwd("~")
when you are elsewhere
List all files and folders you see in your home folder.
Get your cell phones ready to scan a QR code!
use function file.copy
path: "../cinkova/2024-10-11__02"
readLines
to read the first 10 lines of the csv file Atlantyk…
look up read.delim
and pick a function to read the entire file as a table
stringr::str_c
[1] "1 tbsp lemon peels, 2 cups banana pulp, 3 glasses cherry sap"
a <- c("lemon peels", "banana pulp", "cherry sap")
b <- c(1, 2, 3)
c <- c("tbsp", "cups", "glasses" )
str_c(b, c, a, sep = " ", collapse = ", ")
[1] "1 tbsp lemon peels, 2 cups banana pulp, 3 glasses cherry sap"