Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . What is the output of the following commands? Try to predict the solutions before you type in the commands. We define: x <

1. What is the output of the following commands? Try to predict the solutions before
you type in the commands. We define:
x <- c(5,2,1,4); xx <- c(1,10,15,18); y <- rev(10:15);
yy <- seq(length =10, from =9, by =2)
z <- c(TRUE, FALSE, TRUE, TRUE); w <- c("Marie", "Betty", "Peter");
v <- c("I", "list", "key", "standard", "attraction")
(a)
order(x)
sum(x)
range(x)
length(y)
sum(yy)
(b)
c(xx, yy,12)
(c)
xx - x
c(x,12)* y
1:6+1
1:9+1:2
log(xx)
(d)
x <=2
(x <2) & z
x <(2 & z)
(x ==1)+2
(e)
substring(w,2,4)
paste(substring(w,1,2), substring(w,5,5), sep ="..")
paste(substring(v,1,2), collapse ="")
(f)
rbind(x,xx)
cbind(2,6:1, rep(c(3,1,4),2), seq(1,1.6, by =0.05)

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions