Which type of R object can be used to store data that contain a factor variable and a numerical variable with different lengths?
A) data frame B) list C) matrix D) array
Which of the following function is not for importing data in
R?
A) read.table( ) B) scan( ) C) read.csv( ) D) write.table( )
1) For this part I'll write the type of data each vector can contain:
Vector: Here all elements must be of the same type.
Matrix: It is a special kind of vector. It is a vector with two more attributes namely the number of rows columns.
Array: It is similar to the matrix but can more dimensions.
List:: The cost Iist can contain elements of different types.,
Data frame: A data frame is used for storing data tables. It is a list of vectors of equal length.
Thus the answer is: B) list
2) A) read.table( ) reads a file in table format and creates a data frame from it.
B) Scan(): Read or scans data into a vector or list from the console or file
C) read.csv( ): Read data from a csv file.
D) write.table(): prints its required argument from a data frame.
Thus the answer is D)write.table()
Get Answers For Free
Most questions answered within 1 hours.