I am trying to rewrite the code of this paper: https://doi.org/10.1038/s42003-020-0837-0
I have written the code step-by-step based on the instructions mentioned in the methods section. But after clustering, for plotting the clusters by dimplot, I receive a dissimilar plot compared to the same plot in the paper.
I wonder what is the problem? I have tailored every parameter to receive the same plot but it hasn't worked yet.
Graph of the paper
My graph
Please help me to solve this issue.
Related
attached you see a decision boundary graph of a classification algorithm made in ggplot(from this great article)I was curious about if it is possible to replicate such graphs in highcharter, or more specifically: Is it possible to create custom boundary lines / areas for different classification algorithms? I would highly appreciate an example and thank you for your support.
I am relatively new to R and interested in Plotting Dose-Response curves. I have discovered GRMetrics which I found is very useful.
Example (as given in the documentary) will produce a scatter blot and plots the approximated function above them - perfect but how to persolanize the plot design with respect to the color of the points and curves, axis labels, thickness, etc.
In the documentaiton I found it is compatible with ggplot2 but I didn't found any example and didn't manage to integrate the output of GRMetric in a ggplot environment to edit the graph.
I appreciate any suggestion how to solve this issue.
The installation and code for GRMetrics:
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("GRmetrics")
install.packages("foreign")
browseVignettes("GRmetrics") #link to documentation
library(GRmetrics)
data(inputCaseA)
head(inputCaseA)
drc_output = GRfit(inputCaseA, groupingVariables =c('cell_line','agent'))
GRdrawDRC(drc_output)
In case someone is interested: one solution I found for this problem is....
1) export the curve parameters and data points from GRdrawDRC. The GRmetrics packages uses sigmoidal fitting and the function is given in its documentation
2) copy/insert the curve and all parameters in ggplot (e.g. as stat_function + geom_point()).
Then you are off to go and can format the graph easily.
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 would like to produce some nice PCA plots in R. As usual, in R, there are several ways to perform a principal component analysis. I found so far 3 different ways of how to calculate your components and 3 ways of plotting them. I was wondering whether people who are familiar with these functions can give me some advise on the best combination of functions to produce the following plots:
Scores Plot
Loadings Plot
Histogram / Bar chart of the variances explained by each principal component
My research on functions and plots used for PCA in R resulted in:
Functions:
pca.xzy()
prcomp()
princomp()
dudi.pca()
Plot:
plot.pca (this one seems to belong to the function pca.xzy())
ggplot2
plot
biplot
I also found the following webpage:
http://pbil.univ-lyon1.fr/ade4/ade4-html/dudi.pca.html
And I was wondering if you can draw those circles and lines starting from each of the circle centers with one of the other functions mentioned above as the function dudi.pca from the ade4 package seems to be the most complicated one.
One question per question, please! There's psych package by William Revelle, see this and this. There's also a good tutorial here. Anyway...
for scores/loadings plot see pairs
histogram: see hist
So once again, what's your question actually? =)