Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Why is this R code a _ vector - 1 : 1 0 0 0 another _ vector - a _ vector + 1 preferable

Why is this R code
a_vector -1:1000
another_vector - a_vector +1
preferable to this R code?
a_vector -1:1000
another_vector - a_vector
for(i in another_vector){
another_vector [i]-i+1
}
The second example's code will give the wrong answer.
The second example's code will cause an error.
It is faster.
It is shorter.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

When and how will strategy reviews take place?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago

Question

7. What decisions would you make as the city manager?

Answered: 1 week ago