# 1. In R, you can choose almost any name you like for an object, as long...

###### Question:

1. In R, you can choose almost any name you like for an object, as long as the name does not begin with a number or a special character like +, -, *, /, ^, !, @, or &.

Note: Remember that the most helpful names will remind you what you put in your object.

Which of these would be valid object names?

^-^

+1

foo

var

2. If your vector contains a sequence of contiguous integers, you can create it with the : shortcut. If run 1:5 in command line. What do you get?

1, 2, 3, 4, 5

[1] 1 2 3 4 5

1 : 5

3.

You can extract any element of a vector by placing pair of brackets behind the vector. Inside the brackets place the number of the element that you’d like to extract.

If you assign vec <- c(1, 2, 4, 8, 16), then vec[3] would return:

vec[3]

4

16

3

4.

Vector recycling: Predict what the code below will return.

$1 + c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)$

1] 3 4 5 6 7 8 9 10 11 12

[1] 0 1 2 3 4 5 6 7 8 9

[1] 2 3 4 5 6 7 8 9 10 11

#### Similar Solved Questions

##### Calculate the mass in grams, of KNO3(s) needed to make 750 mL of a 1.65 M. solution.
Calculate the mass in grams, of KNO3(s) needed to make 750 mL of a 1.65 M. solution....
##### 1. In your own words, explain what Korsakoff Syndrome is. 2.How does FTD differ from Alzheimer’s...
1. In your own words, explain what Korsakoff Syndrome is. 2.How does FTD differ from Alzheimer’s disease? 3. Give two examples of how the progression of dementia impacts on a person. 4.  What is the link between the onset of dementia and depression? 5. . Why might a person with demen...
##### How do you solve the right triangle if a=3.0cm, b=2.6cm, C=90°?
How do you solve the right triangle if a=3.0cm, b=2.6cm, C=90°?...
##### Comparability and Consistency in Income Statements The following income statements were provided by Chisholm Company, a...
Comparability and Consistency in Income Statements The following income statements were provided by Chisholm Company, a wholesale food d 2017 2016 Sales $1,760,000$1,560,000 Cost of sales Sales salaries Delivery expense Office supplies $642,400$466,440 432,960 416,520 186,560 182,520 $56,320$54,6...
##### ABC Corp has a beta of 1.5, the current risk-free interest rate is 3%, and the...
ABC Corp has a beta of 1.5, the current risk-free interest rate is 3%, and the expected return on the market is 12.0%. The market cap of ABC is $2 billion and the company has one 10-year bond outstanding with face value of$1 billion and coupon of 5%. The bond is trading at a premium price of 110. T...
##### MacCorp uses process costing. Conversion costs are added continuously throughout the process and direct materials are...
MacCorp uses process costing. Conversion costs are added continuously throughout the process and direct materials are added at the beginning. During February, Department B had a beginning inventory of 2,000 units, 40% complete. Department A transferred out 18,000 units during the month to Department...
##### 6) A ball is thrown across a playing field fror Toss a playing field from a...
6) A ball is thrown across a playing field fror Toss a playing field from a height of 4 ft above the ground at an angle of 45 to the horizontal at a speed of 20 fus. It can be deduced physical principles that the path of the ball is modeled by the function x + x +4 a. At what horizontal distance x i...
##### Questions 1, 2 and 3 are based on the following epidemiological data A village has a...
Questions 1, 2 and 3 are based on the following epidemiological data A village has a total population of 1,000 and the hospital is reporting cases of Disease X The following data was collected YEAR Total With Disease XNew cases of XCured of X At beginning of year r the year By end of year 2013 100 2...