Skip to content

Commit

Permalink
rearrange namespace and function inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
mckennapsean committed Jan 6, 2015
1 parent 412325c commit 8faf99c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 31 deletions.
10 changes: 6 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ useDynLib("scorr")

export(
"scorr",
"scorr.highlight.index",
"scorr.highlight.name",
"scorr.set.primary",
"scorr.set.secondary",
"scorr.get.primary",
"scorr.get.secondary",
"scorr.get.size",
"scorr.get.selected",
"scorr.get.density",
Expand All @@ -12,8 +14,8 @@ export(
"scorr.get.cor",
"scorr.get.acor",
"scorr.get.name",
"scorr.set.primary",
"scorr.set.secondary",
"scorr.highlight.index",
"scorr.highlight.name",
"scorr.close",
"scorr.plot"
)
49 changes: 22 additions & 27 deletions R/scorr.r
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@



scorr <- function (data, perms = 0, threshold = 0, coloring = 1:nrow(data),
useDensity = T, showProfile = T, showPatch = F ){
scorr <- function (data, useDensity = T, showProfile = T, showPatch = F, threshold = 0, coloring = 1 : nrow(data), perms = 0){

nc <- ncol(data)

Expand All @@ -28,18 +27,23 @@ scorr <- function (data, perms = 0, threshold = 0, coloring = 1:nrow(data),
invisible(data)
}

scorr.close <- function(){
.Call("scorrClose")


scorr.set.primary <- function(v){
.Call("scorrSetProjection", as.double(v), as.integer(length(v)), as.integer(0) )
}

scorr.highlight.index <- function(indices){
.Call("scorrHighlightIndex", as.integer(indices),
as.integer(length(indices)) )
scorr.set.secondary <- function(v){
.Call("scorrSetProjection", as.double(v), as.integer(length(v)),
as.integer(1) )
}

scorr.highlight.name <- function(names){
.Call("scorrHighlightName", as.character(names),
as.integer(length(names)) )
scorr.get.primary <- function(v){
.Call("scorrGetProjection", as.integer(0) )
}

scorr.get.secondary <- function(v){
.Call("scorrGetProjection", as.integer(1) )
}

scorr.get.size <- function(){
Expand Down Expand Up @@ -95,25 +99,16 @@ scorr.get.name <- function(indices){
.Call("scorrGetName", as.integer(indices), as.integer(length(indices)) );
}


scorr.set.primary <- function(v){
.Call("scorrSetProjection", as.double(v), as.integer(length(v)), as.integer(0) )
}


scorr.set.secondary <- function(v){
.Call("scorrSetProjection", as.double(v), as.integer(length(v)),
as.integer(1) )
scorr.highlight.index <- function(indices){
.Call("scorrHighlightIndex", as.integer(indices),
as.integer(length(indices)) )
}



scorr.get.primary <- function(v){
.Call("scorrGetProjection", as.integer(0) )
scorr.highlight.name <- function(names){
.Call("scorrHighlightName", as.character(names),
as.integer(length(names)) )
}


scorr.get.secondary <- function(v){
.Call("scorrGetProjection", as.integer(1) )
scorr.close <- function(){
.Call("scorrClose")
}

0 comments on commit 8faf99c

Please sign in to comment.