#Note that all the examples shown here do not illustrate use of the extra
#options that can be passed to the functions as additional arguments. The
#Individual function help files illustrate the use of optional
#arguments in more details.
#Also, here and in other example sections of code you may see the code preceded
#by "## Not run:" - this refers to sections of code being exempt from R's
#automatic example code checking due to their interactive nature. Lines of code
#that immediately follow "## Not run:" should still be runnable, provided you
#remove the "## Not run:" comment.
### ===== SD.START: =====
#Users not familiar with importing and manipulating data in R will wish to start
#with:
\dontrun{
myboxes <- sd.start()
}
#This will prompt for things like directory and file name, and then walk through
#data inspection, thresholding, and offer to call sdprim.
### ===== SDPRIM: =====
#Users confident in the soundness and appropriate formatting of their data may
#take the following more direct actions:
\dontrun{
#LOAD the data, either via:
mydata <- read.csv("mycsvfile.csv")
#OR
loadedname <- load("myrdafile.rda")
mydata <- get(loadedname)
#Then define their input variables:
xmatrix <- mydata[,columnindexes]
#Then define their output variable using EITHER
outputvar <- mydata[,outputcolumnnumber]
#OR
outputvar <- mydata[,"outputname"]
#If output var is already a 0-1 variable, then sdprim can be called as:
myboxes <- sdprim(x=xmatrix, y=outputvar)
#Otherwise, first threshold the output variable as follows:
outthresh <- 1*(outputvar>threshold)
#Then call sdprim:
myboxes <- sdprim(x=xmatrix, y=outthresh)
}
### ===== SEQ.INFO: =====
#To see a summary of sdprim output,
data(exboxes) #an example box sequence object included with the package
boxinfo <- seq.info(exboxes)
### ===== DIMPLOT: =====
#To see a 'Normalized Dimension Restriction Plot' for box i, type:
data(exboxes)
dimplot(exboxes, 1)
Run the code above in your browser using DataLab