In the exercises below we cover the basics of lists. Before proceeding, first read section 6.1-6.2 of An Introduction to R, and the help pages for the
Answers to the exercises are available here.
then what is the value of
b. “A” “B” “C”
then which R statement will replace “A” in
x with “K”.
a , which R statement will give the sum of all elements in
Newlist , write an R statement that will add 1 to each element of the first vector in
b , write an R expression that will give all elements, except the second, of the first vector of
x , write an R statement to add a new item z = “NewItem” to the list x.
y , write an R statement that will assign new names “one”, “two” and “three” to the elements of y.
x , write an R statement that will give the length of vector
string , write an R statement to split this string into two and return the following output:
Write an R statement that will return all elements of q that are not in y, with the following result: