The RStudio website has a very interesting visualization as shown below:
https://gallery.shinyapps.io/TSupplyDemand/
Unfortunately, I cannot seem to pin down the source code, package, or even more simply, the name of this visualization.
I would greatly appreciate it if anyone was able to point my research in the right direction. I suspect that knowing the name of the visualization will help me resolve the remaining questions quite quickly.
It's a Sankey Diagram, where the width of the edges is proportional to the amount transferred between nodes.
https://en.wikipedia.org/wiki/Sankey_diagram
This answer on SO suggests that rCharts can be used to create such plots.
Related
I am trying to plot gsea similar to image as given below:
the tutorial does not give you such plots. So I tried the github link.
But it failed to generate the similar plot
I checked both gseaplot2{enrichplot} and plotEnrichment{fgsea} and found no options to automatically add the group names. It might be a good idea to just add the names after exporting to Adobe Illustrator. Would be happy to hear other ideas though if anyone else knows a better way.
I'm using Tensorboard to visualize the training of a neural network in R. Tensorboard gives really nice graphs of the accuracy, the loss, validation accuracy etcetera. I would like to download these graphs (including smoothing and legend) just like one can download the graph of the nodes. Is this possible? I know that you can download the data one by one, but then you would have to make the graph manually including the smoothing and legend. This would be a lot of work, while you already have such a nice looking graph. I have tried using SVG Crowbar, but I don't know which one to download (if this even works...). I do not know what to do. The best solution thus far seems to be using printscreen and paint.
Thanks in advance for helping me!
Sorry for the question, but I have a variable that I would like to plot like this:
I am a newby on R, so I am having some difficulties. I appreciate any kind of help.
Thanks!
Since you're looking to plot what appears to be a 3d surface, I'd suggest starting with the persp function, from the graphics package. This blog post (http://www.r-bloggers.com/3d-plots-in-r/) gives a good treatment of several options for 3D plotting:
the generic function persp() in the base graphics package draws perspective plots of a surface over the x–y plane. Typing demo(persp) at the console will give you an idea of what this function can do.
And running demo(persp) gives you a number of examples, including this one:
There are also some more suggestions for going further:
The plot3D package from Karline Soetaert builds on on persp()to provide functions for both 2D and 3D plotting. [...] Load the package and type the following commands at the console: example(persp3D), example(surf3D) and example(scatter3D) to see examples of 3D surface and scatter plots.
As a side note, #rawr's comment is spot on - I found all this in less than a minute, using two google searches - one of which was the title of your post. I'm putting this answer up anyway, since StackOverflow posts frequently become the top google result for many topics. But the best advice I can give you going forward is that R is one of the most aggressively well-documented languages out there, both in terms of formal and informal documentation, and you can find a lot just by googling what you want to do.
I made a heatmap on R and most of it is one colour. I have two columns of data which showed up as various colours, but the rest of it is red.
Does anyone know how to increase the "resolution" of this? I don't mean anything about how to make the image more clear (which is why I think I'm having trouble searching for info on it). I mean, how do I make my heatmap more meaningful and not all mostly one colour.
Thanks and sorry if this has been answered somewhere else. I think I don't know the key term I need to search properly.
Edit:
Here is the code I used so far (heatdata is my matrix):
heatmap <- heatmap(heatdata,Rowv=NA,Colv=NA,col=cm.colors(256),scale="row")
I'm trying to draw some appealing curved arrows on top of a map. The best looking arrows that I can find are network.arrow() from the network package. However, when I make them curved things get weird. Compare the following:
library(maps)
library(network)
map("usa")
network.arrow(-110,37,-85,40,length=5,width=1,angle=20)
map("usa")
network.arrow(-110,37,-85,40,length=5,width=1,angle=20,curve=2)
I find it difficult to believe that network.arrow() would integrate a curve option that inherently makes the arrowheads look bizarre, and yet I cant get it perform properly. How can I fix this?
Note: I am aware of great circle, and no, I'm not trying to get flight paths drawn properly. The data I am trying to visualize is on a much smaller scale than the example presented here.