All Questions
56,022
questions
-1
votes
1
answer
27
views
Produce table with data bars in base R or ggplot2
I am looking to make a table with horizontal bar graphs in each cell to display continuous numeric data with 2 categorical independent variables. It would look similar to the below (fictional data):
...
0
votes
0
answers
21
views
Making a ggplot2 Sankey plot in R less crowded
If I have a dataframe in R (called connections_df), that shows the connections between the two endpoints (endpoint1 and endpoint2) with the corresponding chromosome (CHR):
endpoint1 ...
-1
votes
0
answers
33
views
Making lines not overlap
I am creating a DGE plot for 2 samples. I want the lines in the resulting plot to NOT BE STACKED on top of each other, bot to be next to each other (so that both are visible).
## Load packages
if (! ...
-1
votes
0
answers
17
views
In ggHoriPlot, geom_horizon will create fill Categories. What the meanning?
In ggHoriPlot,geom_horizon will create fill Categories ypos3 .. yneg1 ..yneg13 ,refer to the legend in attached image.
How to understand Categories and it's created according what kind of logic ? ...
0
votes
1
answer
21
views
how can I force the scale in ggplot to be in the middle of the data range?
In the plot below, the range in a goes from 0.001 to 0.7 but the legend doesn't have the middle value in the cyan color. Is there a way I can force that the middle value in the range of a be in the ...
1
vote
0
answers
24
views
Fix order of stacks but allow colour to change
The data and code for this question were adapted from:
How to fill colors of stacked bar plot depending on colors column of df in R using ggplot
I want to fix the order of country appearance in each ...
0
votes
1
answer
35
views
move inset plot legend
I have an inset plot with a legend that I want to be shown at the bottom of the overall figure. This legend isn't the same for the larger plot, since I added more layers to the inset plot. How can I ...
0
votes
1
answer
19
views
How to adjust x axis in coefficient plot with sjPlot's plot_model when x value range is smaller than -1,1?
I'm plotting multiple regression coefficients with plot_model and the x axis is automatically set to -1,1 even though the possible range of my values is smaller, which makes the estimates hard to see ...
1
vote
1
answer
22
views
as.ggplot in dendextend does not leave enough room for leaf labels
I've been using ggplot2 for automated report generation, and had been using ggdendro for accompanying dendrograms. However, as ggdendro seem to no longer be actively supported and I encountered this ...
-1
votes
2
answers
48
views
R, ggplot2 - time on x axis
In R I have a data frame with bid and ask prices for a single day. Here is an example:
TimeHM; Bid_Price1; Ask_Price1
08:12; 101; 102
08:13; 101; 102
08:14; 102; 104
...
17:05; 104; 105
So, each new ...
3
votes
1
answer
40
views
Keep ggplot font size constant in different figure dimensions
I'm in a position that requires me to frequently change the dimensions of my plots via the fig.dim=c(...,...) option in each r chunk.
However, I have a problem that I haven't been able to solve yet.
...
1
vote
1
answer
21
views
How to Add Significance bars a Bar Plot that have percentage/logical data
I have a dataframe with a categorical variable and a few logical variables. I’ve created an example using the iris dataset:
# Create a new dataframe showing the percentage each variable that is ...
-1
votes
1
answer
29
views
geom_text_repel only displays 2 labels when it should be all [closed]
I have code in r to create a plot with labels on the points
library(tidyverse)
library(ggrepel)
set.seed(123) # Set seed for reproducibility
# Generate random strings for the country, party, ...
-1
votes
2
answers
40
views
creating a looped stacked barplot with ggplot in R
I am trying to create a stacked barplot with ggplot in R. I have the following dataframe:
Sample
Date
Organism
Antibiotic
Resistance
1
01/01/2020
E Coli
Amoxicillin
S
1
01/01/2020
E Coli
Gentamicin
...
0
votes
1
answer
53
views
Is there an R-function to interpolate contours which fits a shapefile?
I am plotting contour maps using R. The program is able to plot the contours but it is not able to interpolate the plot to fit and fill the provided shapefile. Is there a specific function in R which ...