Statistical Computing, 36-350
Week of Monday July 8, 2019
Vectors
## [1] FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE FALSE
Matrices
## [1] 1 5
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 1 1 2 3 5 8
## [2,] 2 4 8 16 32 64
## [3,] 0 1 0 -1 0 1
List
my_list_1
)my_list_1
)my_list_2
)data.frame 1. make a data frame with all vector components… (my_df
) 2. shorten them so you can (my_df
) make a matrix with just x_mat2 in it. What will the columns names be? (my_df_2
)
x1
1 if the index is odd and -1 if the index is evenx2
entries so that if they’re false - they’re now true if the index is even (else leave as is)x1
are greater than 5?x_mat2
are greater than 5? Comment on format?x2
(what are all the ways we could do this?)16
out of x_mat2
(what are all the ways we could do this?)my_df
x_mat2
equal to 0x2
individually