Questions tagged [gplots]

Various R programming tools for plotting data

gplots: Various R programming tools for plotting data

164 questions
2
votes
2 answers

Save heatmap.2 in variable and plot again

I use heatmap.2 from gplots to make a heatmap: library(gplots) # some fake data m = matrix(c(0,1,2,3), nrow=2, ncol=2) # make heatmap hm = heatmap.2(m) When I do 'heatmap.2' directly I get a plot that I can output to a device. How can I make the…
Martin Preusse
  • 9,151
  • 12
  • 48
  • 80
1
vote
2 answers

ggplot graph with line above and below the median

I am trying to make a ggplot graph with two regression lines: One below and the other above the median to depict potential effect of age in the sample. So fa, I have tried: geom_hline (aes(yintercept = median(df$y) I do not get anything. I can also…
Yacila
  • 13
  • 3
1
vote
0 answers

gradient not showing low colour in ggplot2

My question is the same as this one, but I'm seeing the mid color, but not the low color in scale_fill_gradient2(). How can I display all low, mid and high colours in scale_fill_gradient2() ? No sign of…
Larissa Cury
  • 806
  • 2
  • 11
1
vote
0 answers

why do I get sample is too sparse to find TD using beanplot?

I am trying to draw a beanplot with the following code: library(beanplot) beanplot(df, col="#cccccc", names="plot-1", yaxt="n", overallline="median", ll=0.00001) I get the following error: Error in bw.SJ(x, method = "dpi") : sample is too sparse…
Exploring
  • 2,493
  • 11
  • 56
  • 97
1
vote
0 answers

how invert the order of factors in ggplot

I am trying to reverse the order of the fill factor on the graph, i.e. The 0.5-1 class, must be at the top of the bar.. and then in descending order gruppo <- c("TM", "TM","TM","TM", "PM", "PM","PM","PM") valor <-c(1,4,237,3433,1,3,240,3700) class…
Johanna Ramirez
  • 161
  • 1
  • 9
1
vote
1 answer

Is there a way to obtain residual plots for all interaction terms?

I am working on an exercise asking me "Plot the residuals against Y_hat, each predictor variable, and each two-factor interaction term on separate graphs." Here is a snippet of the data set I am using: > dput(head(Commercial_Properties,…
D.C. the III
  • 340
  • 3
  • 14
1
vote
1 answer

How do i put multiple separate charts onto one pdf in r

I am having trouble figuring how to put 6 separate bar plots onto one pdf. This is one of the plots for example (they are all very similar): barplot(druhy, ylim = c(0,50), main = "Míváš často chuť na svíčkovou?", col = c("red", "blue", "green",…
1
vote
1 answer

How to plot different and independent color gradient legend in heatmap.2 (R)

I obtain a matrix from calculation where the values are between 0 and 4. I use the function heatmap.2 to plot. The idea is to have a color code and with different gradient in function of the cell value: from 0 to 0.99: gradient of red from 1 to…
Laurent
  • 419
  • 4
  • 14
1
vote
1 answer

How to plot axes in Filled.contour?

I have used filled contour to convert a matrix into an image with a color gradient. The names of my axes show on the plot but not the scale and values. The plot.axes function does not return any error but doesn't add anything to my plot so I guess…
Janet
  • 21
  • 2
1
vote
1 answer

How to manipulate the n.label values with paste0() for the number of observations using the plotmean() function in the gplot() package in R

Problem: I have a data frame called FID and I want to label the number of observations for each mean and the upper and lower confidence intervals. Because the data frame shows the number of observations per month over three years (below), the…
Alice Hobbs
  • 1,021
  • 1
  • 15
  • 31
1
vote
1 answer

how to get the list of genes in each cluster of a heatmap in R

I have used the following code to make this heatmap for my large dataset. Now I want to get the name of rows (name of the genes) for the second cluster (red on the left and green on the right). First I tried to follow the instructions on this page…
mahdi.kh
  • 33
  • 5
1
vote
0 answers

R Studio gplots library 'coplot' function: "Error in eval(y, data, parent.frame()) : object 'y' not found"

I am trying to do the "Fixed/Random Effects Models using R" exercise found at (https://rstudio-pubs-static.s3.amazonaws.com/372492_3e05f38dd3f248e89cdedd317d603b9a.html) However, for homework I have been asked to use a different dataset containing…
Hugo
  • 11
  • 1
1
vote
0 answers

dependency ‘caTools’ is not available for package ‘gplots’

I am trying to install the gplots package (Xubuntu 18.04.03, R 3.4.4). gplots need caTools. But "dependency ‘caTools’ is not available for package ‘gplots’". This is on a fresh R install. My question is, how do I need to proceed to get gplots…
akratz
  • 57
  • 7
1
vote
0 answers

textplot function: How to center the text within a table?

I can't get my head around centering the text correctly within tables using the textplot funtion. I have written the following code so far: jpeg("Equity_Regions_TAA_Scorecard.jpg", width = 7.0, height = 3.5, units="in", res=200, pointsize=5) …
AnDr
  • 65
  • 5
1
vote
1 answer

How can I delete column names in heatmap.2 in R?

I've built a great heatmap.2 in R but I am trying to remove the column names at the bottom of the heatmap because they are illegible. I am not able to delete the column names. I've tried doing labCol = NULL and nothing seems to happen. Additionally,…