n_dims <- floor(runif(1,3,11))
# random number between 3 and 10


d_vec <- 1:(n_dims^2)

m <- matrix(data=d_vec,nrow=n_dims)
# makes the matrix to n_dims squared 

shuffled <- sample(m)
# to shuffle

print(shuffled)

print(m)

m2 <- t(shuffled)
#transposes matrix (m)

print(m2)


print(m3)

m2[1,rowSums(m2)]
rowSums(m2)

sum(m[1,])
sum(m[6,])
# sums of first and last row

mean(m[1,])
mean(m[6,])
# find the mean of each line

eigen(m)
# these numbers are double and a list

typeof(eigen(m))
# a list
my <- runif(16)
my_matrix <- matrix(data=my,nrow=4)
# creates a 4x4 of the random values from my

typeof(my_matrix)

my_logical <- as.logical(round(runif(100)))
# to create logicals

typeof(my_logical)

my_letters <- sample(letters[1:26])
# create random letters

typeof(my_letters)

mynew <- list(my_matrix[2,2],my_logical[2],my_letters[2])
print(mynew)
# create a new list, which has the element[2,2] from the matrix, the second element of the logical vector, and the second element of the letters vector.

mynew <- c(my_matrix[2,2],my_logical[2],my_letters[2])
print(mynew)

typeof(mynew)
# is a character after c()
my_unis <- runif(26, 0:11)
my_letters <- sample(LETTERS[1:26])

df <- data.frame(my_unis, my_letters)

df[sample(nrow(df),4),] <- NA
# to select for row 4 only and to replace with NAs

missing <- df[rowSums(is.na(df)) > 0,]
missing
#all are NaN or NA except for a 4

alphabetical <- df[order(df$my_letters),]
alphabetical
# to make letters into alphabetical order

mean(df$my_unis, na.rm=TRUE)
# to give you the mean of the first column