Getting ready

Consider a situation where you have a dataset with 500 columns representing 500 binary variables of a certain characteristic. In the dataset, you have a total of 900 observations. The objective is to calculate the frequency of 1's in each of the 500 variables and all the possible pair-wise combinations of the variables. The dataset is given in the CSV file, so to implement this recipe, you will need to read the dataset from the CSV file and then convert it into a matrix as follows:

    bigBinaryData <- read.csv("loopVectorization.csv")
binMat <- as.matrix(bigBinaryData) # to convert data frame into a
matrix
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset