powered by
incol is a utility to determine whether a names columns is present in a given matrix or data.frame.
iscol(incol = "year", inmat)
the name of the column; defaults to "year" as an example
the matrix or data.frame within which to search for incol
TRUE or FALSE
# NOT RUN { x <- 1:10 test <- matrix(x,nrow=5,ncol=2,dimnames=list(1:5,c("year","Catch"))) print(test) iscol("year",test) iscol("Catch",test) iscol("catch",test) iscol("ages",test) # }
Run the code above in your browser using DataLab