Question

In: Statistics and Probability

R software Create a list made up of two Vectors, two Data frames and Two Matrices....

R software

Create a list made up of two Vectors, two Data frames and Two Matrices.

i) Name the elements of the list appropriately

ii) Output just the two vectors

iii) Output just the two matrices

Solutions

Expert Solution

#Code of the required program

v1=c(1,2,3,4,5) #creating the first vector
v2=c(6,7,8,9,10) #creating the second vector


name1=c("A","B","C","D")
age1=c(10,12,15,20)
name2=c("E","F","G","H")
age2=c(16,19,21,22)
d1=cbind(name1,age1)
d2=cbind(name2,age2)
dd1=data.frame(d1) #creating the first data frame
dd2=data.frame(d2) #creating the second data frame

m1=matrix(c(1,2,3,4,5,6,7,8,9),nrow=3,byrow=T) #creating the first matrix of order 3*3
m2=matrix(c(9,8,7,6,5,4,3,2,1,0,7,4),nrow=4,byrow=T)#creating the second matrix of order 4*3


L1=list(v1,v2) #creating first list containing 2 vectors
L2=list(dd1,dd2) #creating second list containing 2 dataframes
L3=list(m1,m2) #creating third list containing 2 matrices

L=list(L1,L2,L3) # creating list of lists

L[[1]] #printing the 2 vectors, which are the 1st element of the main list
L[[3]] #printing the 2 matrices, which are the 3rd element of the main list

#(The image attached with is the required output of the program)


Related Solutions

How do you graph integers in r studio. I made new data frames for specific parts...
How do you graph integers in r studio. I made new data frames for specific parts of the data I wanted to use and then got the sum of a column and saved it as a variable under values. My goal is to know how to graph these integer values in a barplot comparing all the values.
Describe the set of all unit tight frames with exactly five vectors, up to PRR-equivalence.
Describe the set of all unit tight frames with exactly five vectors, up to PRR-equivalence.
A) Create two vectors in R3 ( 3D vectors) such that they are orthogonal. b) Using...
A) Create two vectors in R3 ( 3D vectors) such that they are orthogonal. b) Using the two vectors from a) above, determine the cross product of the two vectors c)Is it possible to write the vector [0,0,1] using scalar multiples of these vectors?
A contingency table, also called a two-way table, is made up of r rows and c...
A contingency table, also called a two-way table, is made up of r rows and c columns. In general, how many cells are in a contingency table with r rows and c columns? 1) r x c (r times c) 2) (r-1)(c-1) 3) r + c In general, how many degrees of freedom are associated with a contingency table with r rows and c columns? 1) r + c 2) r times c 3) (r-1)(c-1) When should Fishers Exact Test...
Create a list of the top 10 software engineering requirements for the organization. This list should...
Create a list of the top 10 software engineering requirements for the organization. This list should address requirements that are common to most of the software development projects rather than specific project requirements. Include descriptions for each of the requirements that provide sufficient information to align the requirements with architectural strategies that were defined in the previous week. Add the subtitle: Architecture Strategy Evaluation Discuss the pros and cons of the architectural strategy.
CELL BIOLOGY Animal extracellular matrices are made up of 1) fibers (predominantly collagen and elastic), 2)...
CELL BIOLOGY Animal extracellular matrices are made up of 1) fibers (predominantly collagen and elastic), 2) GAGs and proteoglycans, and 3) adhesive glycoproteins (such as fibronectin and laminin). Describe the structures and functions of each class of molecule in the extracellular matrix.
create a class matrix.Let U and V be the two matrices of type Int and number...
create a class matrix.Let U and V be the two matrices of type Int and number of rows and columns are user defined. Write the following member functions of the class a) Add Add the two matrices U and V. For this, add the corresponding entries, and place their sum in the corresponding index of the result matrix. b) Subtract Subtract the two matrices U and V. For this, subtract the corresponding entries, and place this answer in the corresponding...
An RLC circuit is made up of a resistor R = 12Ω , a capacitor C...
An RLC circuit is made up of a resistor R = 12Ω , a capacitor C = 0.1 F and an inductor L = 2 H. A voltage source is connected that supplies 110 V. If initially the capacitor is discharged and no current flows through the circuit, find an expression for the charge at all times t. differential equations
Using Python, create a function whose inputs are two matrices and whose output is the element...
Using Python, create a function whose inputs are two matrices and whose output is the element wise product of the two matrices.
Two vectors in polar coordinates (R, θ) are given byV1 = (5.0, 125°) and V2 =...
Two vectors in polar coordinates (R, θ) are given byV1 = (5.0, 125°) and V2 = (4.0, 260°). Find the sum V1 + V2 in polar coordinates. Give the answer to 2 significant figures for the magnitude and to the nearest degree in angle. Hint: first convert the vectors to Cartesian form and add them to get the resultant vector. Then convert this resultant vector to polar form
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT