15 etc. 1. What are the arguments for the Sequence Generation function seq() and give an example. Hint, use the methods you have learned to search for help in RStudio. 2. Use R as a calculator to compute the following values. a. 27(38-17) b. In(14') 436 с. 12 3. Create the following vectors in R and use R commands to answer the questions. а %3 [5, 10, 15, 20, ..., 160) b = (87, 86, 85, ..., 56)

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter7: String Manipulation
Section: Chapter Questions
Problem 6E
icon
Related questions
Question
а.
What is the 10th element of b?
b.
What are the 19th, 20th, and 21st elements of a?
с.
What are all of the elements of b which are less than 65?
d.
How many elements of a are greater than 50?
Is the length of a equal to the length of b?
е.
4. Use R to create the following two vectors and answer the questions below using R.
v_1 = (TRUE, TRUE, TRUE, FALSE, FALSE)
v_2 = (TRUE, FALSE, FALSE, TRUE, FALSE)
Add v_1 to v_2 and assign it
a new variable called v_3. What is the result?
a.
b.
What is data type of v 3 and why is this the case?
C.
Coerce v_1 and v_2 to character type and output the result.
d.
What happens now when adding v_1 to v_2? Explain your result.
How can you add v_1 and v_2 in their current form? Hint: refer to the Base R Cheatsheet
for help.
е.
5. Calculate the monthly loan payments given the following variables:
The principal amount, L, is $1,500
The interest rate, i, is 1%
The number of payments, n, is 10
The formula for calculating monthly payment, M, is:
M = L* (i / (1- (1 + i)^-n))
а.
Create objects for L, i, and n.
b.
Calculate M and store it in a new object rounded to 2 decimal places. Output your result.
*Exercise 5 taken from FAO-Global Soil Partnership Training onDigital Soil Organic Carbon Mapping, 20-24 January 2018, Yusuf YIGINI,
PhD -FAO, Land and Water Division (CBL) & Guillermo Federico Olmedo, PhD - FAO, Land and Water Division (CBL)
Transcribed Image Text:а. What is the 10th element of b? b. What are the 19th, 20th, and 21st elements of a? с. What are all of the elements of b which are less than 65? d. How many elements of a are greater than 50? Is the length of a equal to the length of b? е. 4. Use R to create the following two vectors and answer the questions below using R. v_1 = (TRUE, TRUE, TRUE, FALSE, FALSE) v_2 = (TRUE, FALSE, FALSE, TRUE, FALSE) Add v_1 to v_2 and assign it a new variable called v_3. What is the result? a. b. What is data type of v 3 and why is this the case? C. Coerce v_1 and v_2 to character type and output the result. d. What happens now when adding v_1 to v_2? Explain your result. How can you add v_1 and v_2 in their current form? Hint: refer to the Base R Cheatsheet for help. е. 5. Calculate the monthly loan payments given the following variables: The principal amount, L, is $1,500 The interest rate, i, is 1% The number of payments, n, is 10 The formula for calculating monthly payment, M, is: M = L* (i / (1- (1 + i)^-n)) а. Create objects for L, i, and n. b. Calculate M and store it in a new object rounded to 2 decimal places. Output your result. *Exercise 5 taken from FAO-Global Soil Partnership Training onDigital Soil Organic Carbon Mapping, 20-24 January 2018, Yusuf YIGINI, PhD -FAO, Land and Water Division (CBL) & Guillermo Federico Olmedo, PhD - FAO, Land and Water Division (CBL)
HW2b: R Exercises 1
Complete R Swirl 2 first! It will help you in this assignment!
Instructions: Write one R script title HW26.R that contains your answers to problems 1- 5. At the top of
the script write your name in a comment. Label each problem number using a comment and then type the
code that solves that problem. Here's an example of the script format (where you should fill in the R code to
solve each problem):
1
# Your Name
# Assignment
3 , # Thu Feb 03 07:39:07 2022
2
4
5
# 1.
6
7
type the R commands
solve problem 1
9.
# 2.
10
11
type the R commands to solve problem 2
12
13
# 3.
|14
15
etc.
1. What are the arguments for the Sequence Generation function seq() and give an example. Hint, use
the methods you have learned to search for help in RStudio.
2. Use R as a calculator to compute the following values.
а.
27(38-17)
b.
In(147)
436
V
С.
12
3. Create the following vectors in R and use R commands to answer the questions.
а 3 (5, 10, 15, 20, ..., 160)
b = (87, 86, 85,..., 56)
Transcribed Image Text:HW2b: R Exercises 1 Complete R Swirl 2 first! It will help you in this assignment! Instructions: Write one R script title HW26.R that contains your answers to problems 1- 5. At the top of the script write your name in a comment. Label each problem number using a comment and then type the code that solves that problem. Here's an example of the script format (where you should fill in the R code to solve each problem): 1 # Your Name # Assignment 3 , # Thu Feb 03 07:39:07 2022 2 4 5 # 1. 6 7 type the R commands solve problem 1 9. # 2. 10 11 type the R commands to solve problem 2 12 13 # 3. |14 15 etc. 1. What are the arguments for the Sequence Generation function seq() and give an example. Hint, use the methods you have learned to search for help in RStudio. 2. Use R as a calculator to compute the following values. а. 27(38-17) b. In(147) 436 V С. 12 3. Create the following vectors in R and use R commands to answer the questions. а 3 (5, 10, 15, 20, ..., 160) b = (87, 86, 85,..., 56)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,