# Filtering matrices

# Create matrix m

m<-matrix(c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), nrow=4, byrow=T)

# Display m

m

# Create new matrix from rows where first value > 7

sub1<-m[m[,1]>7,] # We want rows, so comma is at the end

# Display sub1

sub1

# Create new matrix from columns where highest value < 15

sub2<-m[,m[4,]<15] # We want columns, so comma is at the start

# Display sub2

sub2
