I would like to visualize the workflow of a large function in diagram form using R, I used a package called flow for this purpose, but the given diagram is so blurred and totally unreadable.
Here's a simple example for visualizing the function of interest:
remotes::install_github("moodymudskipper/flow")
library(flow)
library(bvarsv)
data(usmacro)
flow_run(bvar.sv.tvp(usmacro))
Is there any way to improve the visualization and makes it more clear? I also would like to know if there are better methods to visualize the workflows of large functions in R.
Related
I am struggling a bit with an analysis I need to do. I have collected data consisting of little owl calls that were recorded along transects. I want to analyse these recordings for similarity, in order to see which recorded calls are from the same owls and which are from different owls. In that way I can make an estimate of the size of the population at my study area.
I have done a bit of research and it seems that the package warbleR seems to be suitable for this. However, I am far from an R expert and am struggling a bit with how to go about this. Do any of you have experience with these types of analyses and maybe have example scripts? It seems to me that I could use the function cross_correlation and maybe make a pca, however in the warbleR vignette I looked at they only do this for different types of calls and not for the same type call from different individuals, so I am not sure if it would work.
to be able to run analyses with warbleR you need to input the data using the "selection_table" format. Take a look at the example data "lbh_selec_table" to get a sense of the format:
library(warbleR)
data(lbh_selec_table)
head(lbh_selec_table)
The whole point of these objects is to tell R the time location in your sound files (in seconds) of the signals you want to analyze. Take a look at this link for more details on this object structure and how to import it into R.
I'm trying to make a hierarchical clustering tree from the clustering produced by Seurat's clustering function. Their functions, BuildClusterTree and PlotClusterTree, produce a frankly ugly tree based on SNN (shared nearest neighbor) algorithm that you can't manipulate with ggplot2. I'm trying to figure out how to use other functions to plot the clustering already produced by Seurat, but I can't figure out how or what R package would work best. Does anyone have any advice for me?
I would suggest the clustree package for this purpose
I have been looking into this for a while now and I cannot seem to find an integrated approach for this. I have some discrete and some continuous variables ( which can be discretized, but ideally I would like to keep them continuous).
I know there is other (some open source) options, however I would like to stick to R, as I am planning on doing statistical analysis.
QUESTION: Is there a package (other than bnspatial) in R to build Bayesian networks with spatial data? Ideally with an comprehensive example.
Here is my problem:
I have a big dataset that in R that represent an object of ~500MB that I plot with ggplot2.
There is 20 millions num values to plot along an int axis that are associated with a 5 level factor for color aesthetics.
I would like to set up a webapps where users could visualize this dataset, using different filter that rely on the factor to display all the data are once or for example a subset corresponding to 1 level of the factor.
The problem is that when I write the plot it takes a couple of minute (~10 minutes)
Solution 1 : The best one for the user would be to use Shiny UI. But is there a way to have the plot already somehow prewritten thanks to ggplot2 or shiny tricks so it can be quickly displayed?
Solution 2 : Without shiny, I would have done different plots of the dataset already and I will have to rebuild a UI to let user visualizes the different pictures. If I do that I will have to restrict the possible use cases of displaying the data.
Looking forward for advices and discussions
Ideally, you shouldn't need to plot anything this big really. If you're getting the data from a database then just write a sequence of queries that will aggregate the data on the DB side and drag very little data to output in shiny. Seems to be a bad design on your part.
That being said, the author of highcharter package did work on implementing boost.js module to help with plotting millions of points. https://rpubs.com/jbkunst/highcharter-boost.
Also have a look at the bigvis package, which allows 'Exploratory data analysis for large datasets (10-100 million observations)' and has been built by #Hadley Wickham https://github.com/hadley/bigvis. There is a nice presentation about the package at this meetup
Think about following procedure:
With ggplot2 you can produce an R object.
plot_2_save <- ggplot()
an object can be saved by
saveRDS(object, "file.rds")
and in the shiny server.R you can load this data
plot_from_data <- readRDS("path/.../file.rds")
I used this setup for some kind of text classification with a really (really) huge svm model implemented as an application on shiny-server.
I have a csv of the following format:
person, location, time_of_day, money_spent
I've been going through and seeing how to format data to make it work with the more popular libraries (see: https://sites.google.com/site/daishizuka/toolkits/sna/sna_data), but they seem to be focused on various formats of expressing the connectedness between each member.
I would like to express extra dimensionality to my network by, say, coloring the nodes and connectors different colors according to time_of_day met, or change size of the various dots by money_spent. Can someone give me some guidance as to how I can do that with an implementation of network graphs in R?
I can figure out how to preprocess my data such that it is compatible; I'm just not getting how to implement things to the liking of the SNA libraries such as igraph.
The networkDynamic R package provides data structures for dynamic networks and some basic functionality for importing and manipulating this type of data. You should then be able to do analysis with network, sna, or igraph packages (disclaimer: I'm one of the maintainers of networkDynamic)