Question: Make a function checkerboard() in R according to the specifications: INPUTS: n: an integer: the number of rows and columns of the checkerboard function should
Make a function checkerboard() in R according to the specifications:
INPUTS: n: an integer: the number of rows and columns of the checkerboard
function should generate a matrix with n rows and columns, starting with one and filled with ones and zeros, just like a checkerboard. In particular, elements at odd rows and columns should be ones while elements at even rows and columns should be zeros. If n is not a positive whole number, throw an error of your choice.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
