Description Usage Arguments Examples
Count the number of non-zero value for a vector
1 |
k |
The kth row or column |
data |
A matrix |
index |
This must match one of "row" or "column" to extract the kth row or column vector |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ##---- Should be DIRECTLY executable !! ----
melanoma1=as.matrix(melanoma[,2:dim(melanoma)[2]])
row.names(melanoma1)=melanoma[,1]
genecount(k=6,data=melanoma1,index="row")
## The function is currently defined as
function (k, data, index)
{
if (index == "row") {
x = data[k, ]
}
else {
x = data[, k]
}
return(sum(x != 0))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.