<- function(x, y) {
multiply return (x * y)
}
multiply(3, 3)
[1] 9
Write an equation that returns the remainder of 12 divided by 8.
Write an equation that returns the remainder of 36 divided by 10.
You are given a vector that looks like this:
Write a for loop that loops through your vector and prints any element greater than or equal to 3.
It’s possible for this task to be accomplished in several ways; however, the output of your program should always look like this:
Convert the following character variable to a variable with the data type “raw”:
You should store your raw data in a variable named “raw_data”, print the data to the console, and check the data type with the “typeof” function. Your output should look like the following:
Create a variable named “spending” and give it a value of 120. Then create a variable named “budget” and give it a value of 100. Next, check whether spending is greater than budget and store the resulting logical data in a variable named “over_budget”. Finally, print the value of “over_budget” variable and check it’s data type with the “typeof” function.
Your final output should look like this:
Create a vector named “animal” and give it the following three values: “cow”, “cat”, “pig”. Create a second vector named “sound” and give it the following three values: “moo”, “meow”, “oink”. Finally, create a data frame named “animal_sounds” and assign each of these vectors to be a column.
After printing the resulting data frame to the console, you should get the following output: