Skip to content

Commit

Permalink
Version lista para CRAN, falta checkear algo con LaTeX
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Dec 17, 2012
1 parent 7dc69b9 commit 6f196d6
Show file tree
Hide file tree
Showing 14 changed files with 6,125 additions and 13,413 deletions.
6 changes: 4 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
^.*[.]Rproj$
^wiki$
^playground$
*~
.git
.*~
\.git
.*\.png
.*\.gexf
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export(gexf)
export(processEdgeList)

# Methods
S3method(print, gexffile)
S3method(print, gexffile)
9 changes: 4 additions & 5 deletions R/rgexf.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ gexf <- function(
nodeDynamic=NULL,
edgeDynamic=NULL,
output = NA,
tFormat='double',
defaultedgetype = 'undirected',
meta = list(creator='NodosChile', description='A graph file writing in R using \'rgexf\'',keywords='gexf graph, NodosChile, R, rgexf')
tFormat="double",
defaultedgetype = "undirected",
meta = list(creator="NodosChile", description="A graph file writing in R using \'rgexf\'",keywords="gexf graph, NodosChile, R, rgexf")
) {
require(XML, quietly = T)

Expand Down Expand Up @@ -363,7 +363,6 @@ gexf <- function(
if (is.na(output)) {
return(results)
} else {
print(results, file=output)
message('GEXF graph successfully written at:\n',normalizePath(output))
print(results, file=output, replace=T)
}
}
5 changes: 3 additions & 2 deletions R/rgexf.R~
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ gexf <- function(
edgesWeight,
sum(paste(edges[i,1:2], collapse="") %in% pastededges))
}
#edgesWeight <- 0
}
else edgesWeight <- 0
edges <- cbind(edges, edgesWeight+1)
Expand All @@ -355,13 +356,13 @@ gexf <- function(
# EDGES
xmlEdges <- newXMLNode(name='edges', parent=xmlGraph)
.addNodesEdges(edges, xmlEdges, 'edge')

results <- list(graph=saveXML(xmlFile, encoding='UTF-8'))
class(results) <- 'gexffile'

if (is.na(output)) {
return(results)
} else {
print(results, file=output)
message('GEXF graph successfully written at:\n',output)
print(results, file=output, replace=T)
}
}
5 changes: 3 additions & 2 deletions R/rgexfmethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ print.gexffile <- function(x, file=NA, replace=F, ...) {
}
else {
output <- file(description=file,open="w",encoding='UTF-8')
write(x[[1]], file=output,...)
write(x$graph, file=output,...)
close.connection(output)
message('GEXF graph successfully written at:\n',normalizePath(file))
}
}
}
Loading

0 comments on commit 6f196d6

Please sign in to comment.