theTreeTkArvore {ArvoRe}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

theTreeTkArvore(TheTree)

Arguments

TheTree ~~Describe TheTree here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1 Description of 'comp1'
comp2 Description of 'comp2'

...

Warning

....

Note

~~further notes~~

~Make other sections like Warning with section{Warning }{....} ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--    or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(TheTree) {
        
        num.lin <- dim(TheTree)[1]
        num.levels <- max(TheTree$Level)
        
        for (i in 1:length(.libPaths())) {
                SubDataSet <- subset(TheTree, Level == 1)
                osnodos <- SubDataSet$Node.N
                osnodosnomes <- SubDataSet$Node.name
                osnodostipos <- SubDataSet$Type
                osnodos <- paste(i,".",osnodos,sep="")

                icon.but <- file.path(paste(.libPaths()[i],"/arvoRe/icons/", osnodostipos,".png",sep=""))
                if (file.exists(icon.but)) {
                        icn <- tkimage.create("photo", file=icon.but)
                        tkinsert(treeWidget,"end","root","1.1",text=osnodosnomes, image = icn)
                } else {
                        tkinsert(treeWidget,"end","root","1.1",text=osnodosnomes)
                }
        }
        
        if (num.lin > 1) {
                for (i in 2:num.levels) {
                        SubDataSet <- subset(TheTree, Level == i)
                        osnodos <- SubDataSet$Node.N
                        paisnodos <- SubDataSet$Father
                        osnodosnomes <- SubDataSet$Node.name
                        osnodostipos <- SubDataSet$Type
#                       cat("DEBUG : Criei os nodos \n ", osnodos, " cujos pais são ", paisnodos, "\n")
                                
                        osnodos <- paste(i,".",osnodos,sep="")
                        paisnodos <- paste((i-1),".",paisnodos,sep="")
                                
                        for (j in 1:length(osnodos)) {
                                        tipofilename <- osnodostipos[j]
                                        for (i in 1:length(.libPaths())) {
                                                icon.but <- file.path(paste(.libPaths()[i],"/arvoRe/icons/", tipofilename,".png",sep=""))
                                                if (file.exists(icon.but)) {
                                                        icn <- tkimage.create("photo", file=icon.but)
                                                        tkinsert(treeWidget,"end",paisnodos[j],osnodos[j],text=osnodosnomes[j], image = icn)
                                                } else {
                                                        tkinsert(treeWidget,"end",paisnodos[j],osnodos[j],text=osnodosnomes[j])
                                                }
                                        }
                        }
                }
        }
  }

[Package ArvoRe version 0.1.6 Index]