sctyner / geomnet Goto Github PK
View Code? Open in Web Editor NEWExamples and data for geom_net
Home Page: http://sctyner.github.io/geomnet/
Examples and data for geom_net
Home Page: http://sctyner.github.io/geomnet/
Hi!
I am using geom_net to plot my network data and I am pretty impressed by how useful and nice this package is. Since I am using the line width to represent weighted edges, it would be possible to include an additional legend for line width in my plot? I mean, I would like to have a legend with line width proportional to the values that I have in the dataframe.
I appreciate any help or feedback on this!
Thanks
Gustavo
Layout ALL vertices first, then facet instead of recomputing the layout for each facet.
The package is archived.
When I try to build the github version I get
* creating vignettes ... ERROR
--- re-building ‘geomnet-vignette.Rmd’ using rmarkdown
Quitting from lines 15-112 (geomnet-vignette.Rmd)
Error: processing vignette 'geomnet-vignette.Rmd' failed with diagnostics:
The first two columns of `x` must be of the same type.
--- failed re-building ‘geomnet-vignette.Rmd’
SUMMARY: processing the following file failed:
‘geomnet-vignette.Rmd’
Error: Vignette re-building failed.
Execution halted
After installing last CRAN archived version, when trying to compile first examples in that vignette I also get
Error: The first two columns of `x` must be of the same type.
Further, I get a similar error to the one in CRAN (https://cran-archive.r-project.org/web/checks/2021/2021-06-21_check_results_geomnet.html)
Error: `loops` is `FALSE`, but `x` contains loops.
The following values are affected:
- `x[604, 1:2]`
- `x[605, 1:2]`
- `x[610, 1:2]`
- `x[615, 1:2]`
- `x[617, 1:2]`
- `x[618, 1:2]`
Execution halted
if I do
network::as.network(bloodnet[,1:2], matrix.type = "edgelist")
Error: `loops` is `FALSE`, but `x` contains loops.
The following values are affected:
- `x[13, 1:2]`
- `x[14, 1:2]`
- `x[15, 1:2]`
- `x[16, 1:2]`
- `x[21, 1:2]`
- `x[22, 1:2]`
but not sure as they relates.
I think you could just set hoverinfo="none"
around here:
https://github.com/sctyner/geomnet/blob/master/R/geom2plotly.R#L33
Vertices have strange dots when plotted as .jpg or .png (see below), but not when plotted as .pdf.
Hello,
I am trying to set a range for the linewidth, similar to what I can do with node size:
scale_size_continuous(range = c(3,10))
Is this functionality included in geom_net?
Thank you
Store the coordinates as ..x.. ..y.. à la ..density.. so that they can be removed from the internal structure.
Have legends appear on the right for color, shape, linetype, etc. I'm assuming they will show up once we fix the grouping, but in case they don't I thought I'd make an issue for it.
Hi,
Thank you for creating this amazing product. I am eager to use it to generate network for my analysis. However, I am stuck at step one - I cannot install the package!! Here is the error message. Could you help me identify what the problem would be? Thank you!!
Downloading github repo sctyner/geomnet@master
Installing geomnet
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ
--no-save --no-restore CMD INSTALL
'/private/var/folders/0p/zrfyxxm9021bpfhlybcss75c0000gn/T/Rtmp4Nxf8o/devtoolsfee77a0000a/sctyner-geomnet-b78193e'
--library='/Library/Frameworks/R.framework/Versions/3.1/Resources/library'
--install-tests
hi, i like your package very much and I want to learn it.
when I try your example, I find that I can't find hp.edges.
Can you put the data in your repo or pacakge?
Thank you very much and looking forward to your reply.
Yang
Want to have labels added logically. A vlabel column in data that is TRUE if the vertex should be labeled with its name or FALSE if it shouldn't be labeled. This would replace the current logical vlabel option.
Is this no longer part of CRAN?
geomnet
looks intuitive and versatile. I love how directly and naturally it merges with existing ggplot2
code. As a new user, I am wondering what the best use cases are for geomnet
versus ggraph
or DiagrammeR
. From my reading so far, I suspect that geomnet
graphs are easier and quicker to create and that the ggraph
and DiagrammeR
have more features. Do you think an assessment and some recommendations would be appropriate for the README?
I have a directed graph and the node that everything leads to (only appears in the column "to_id") does not get a label.
linewidth argument is not responsive to values but only when mapped using aes()
library(ggplot2)
library(geomnet)
data("bikes")
# merge into a single data.frame()
bikes_merged <- merge(bikes$trips, bikes$stations, by.x="Start.station", by.y="name", all=TRUE)
# create a factor
bikes_merged$nbDocksfac <- as.factor(bikes_merged$nbDocks)
p <- ggplot(data = bikes_merged, aes(from_id = Start.station, to_id = End.station))
p + geom_net(aes(shape = nbDocksfac), colour = "blue", size = 6, linewidth=0.75, directed = TRUE, curvature=0.3) # shapes are OK
p + geom_net(aes(colour = nbDocks), size = 6, directed = TRUE, curvature=0.3) # gradient colored nodes are OK
p + geom_net(aes(colour = nbDocksfac), size = 6, directed = TRUE, curvature=0.3) # categorical colored nodes are OK
p + geom_net(aes(size = nbDocksfac, colour = nbDocksfac), directed = TRUE, curvature=0.3) # diff size & colour are OK
p + geom_net(aes(linetype = nbDocksfac), colour = "blue", size = 6, directed = TRUE, curvature=0.3) # linetypes are OK
p + geom_net(aes(linewidth = 2), colour = "blue", size = 6, directed = TRUE, curvature=0.3) # fixed linewidth inside aes() is OK
p + geom_net(colour = "blue", size = 6, linewidth = 2, directed = TRUE, curvature=0.3) # fixed linewidth is OK
p + geom_net(aes(linewidth = 0.99), colour = "blue", size = 6, directed = TRUE, curvature=0.3) # bug? linewidth not responsive
Is it possible to add text to the edges in geom_net using the very intuitive geom_net
api?
I do not see anything in the documentation that talks to this
library(geomnet)
library(ggplot2)
x <- structure(list(from = c("a", "b", "d", "f", "g", "e", "c", "i",
"e", "h", "i", "i", "j", "j"), to = c("", "", "", "", "", "a",
"b", "c", "d", "e", "f", "g", "h", "i"), edge_val = c(NA, NA,
NA, NA, NA, 1.6, 2.25, 1.75, 0.95, 1.8, 3.2, 2.6, 2.95, 2.45)), .Names = c("from",
"to", "edge_val"), class = "data.frame", row.names = c(NA, -14L
))
ggplot(x, aes(from_id = from, to_id = to, linewidth = edge_val)) +
geom_net(layout.alg = "fruchtermanreingold", labelgeom = "text",repel = TRUE,
size = 4, labelon = TRUE, vjust = -1, ecolour = "grey80",
directed = FALSE, fontsize = 4, ealpha = 0.5) +
theme_net()
I am not sure if this is a bug or a feature. If this is a feature, adding an argument to offer both would be really helpful.
when creating circles with geom_circle, the radius is proportional to the limits of the figure. Thus, a radius of 0.5 reflects 0.5 times the x and the y axis of the screen. Given it's the radius, it would completely fill the figure. It would be more intuitive and streamlined with other gg functions to have the radius using the actual x and y values on the grid.
kind regards
Youri
edit:
I wrote a solution:
https://github.com/yhoogstrate/geomnet
I am not too deep into the gg enviroment so this probably isn't the most elegant solution.
Appears when facetting, although facetting still works as intended. Issue appears to be with ggplot2:::Layout$get_scales(data$PANEL[1])
.
Hi,
Running R version 3.2.0 (2015-04-16) on x86_64-apple-darwin13.4.0
Allow users to input their own layout ((x,y) coords of vertices and vertex id?).
Maybe this can be done in ggplot2 but to date I can't figure out how. I notice you provide for "labelcolour" in geom_net though. My goal is to generate an even better network plot by making it more readable. Also want to try to integrate "ggrepel." As a teacher myself I really like being able to show students how to produce nice networks without a lot of messing around. You have done a great job with "geomnet."
Best regards
Mike Gallagher
geomnet's no longer on CRAN. I wonder if you plan to get it back, or if you need help doing so?
Grouping doesn't work in the usual ggplot2 way when it comes to aes things.
I suggest adding to which release this sentence in your readme.md refers:
geomnet is a package built on top of the most recent major ggplot2 release.
Error in rep(yes, length.out = len) :
attempt to replicate an object of type 'closure'
how i am suppose to deal with it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.