Learn R Programming

BiBitR (version 0.3.1)

make_arff_row_col: Transform R matrix object to BiBit input files.

Description

Transform the R matrix object to 1 .arff for the data and 2 .csv files for the row and column names. These are the 3 files required for the original BiBit Java algorithm The path of these 3 files can then be used in the arff_row_col parameter of the bibit function.

Usage

make_arff_row_col(matrix, name = "data", path = "")

Arguments

matrix

The binary input matrix.

name

Basename for the 3 input files.

path

Directory path where to write the 3 input files to.

Value

3 input files for BiBit:

  • One .arff file containing the data.

  • One .csv file for the row names. The file contains 1 column of names without quotation.

  • One .csv file for the column names. The file contains 1 column of names without quotation.

Examples

Run this code

data <- matrix(sample(c(0,1),100*100,replace=TRUE,prob=c(0.9,0.1)),nrow=100,ncol=100)
data[1:10,1:10] <- 1 # BC1
data[11:20,11:20] <- 1 # BC2
data[21:30,21:30] <- 1 # BC3
data <- data[sample(1:nrow(data),nrow(data)),sample(1:ncol(data),ncol(data))]

make_arff_row_col(matrix=data,name="data",path="")

result <- bibit(data,minr=5,minc=5,
                arff_row_col=c("data_arff.arff","data_rownames.csv","data_colnames.csv"))

Run the code above in your browser using DataLab