Questions tagged [r]
R is a free, open-source programming language & software environment for statistical computing, bioinformatics, visualization & general computing. Please use minimal reproducible examples others can run using copy & paste. Show desired output entirely. Use dput() for data & specify all non-base packages with library(). Don't embed pictures for data or code, use indented code blocks instead. For statistics questions, use https://stats.stackexchange.com.
508,302
questions
-1
votes
0
answers
13
views
Dplyr ( count for total number/treatment)
I have data frame with two columns the first column is the number of children under the age of five that receive a treatment and the second column classifies the type of the treatment. I would like to ...
0
votes
0
answers
16
views
How to extract from multiple zip files only the csv files whose name starts with a specific string of characters in r?
Let's consider a folder myfile containing more than a hundred zip files (z001.zip, z002.zip, z003.zip ...) each always including 4 distinct csv files whose names always start with these three letters ...
0
votes
0
answers
6
views
Increasing fontsize of numbers in forestplot in R
I am trying to prepare a forest plot for summarizing patient survival outcomes in multiple cohorts using the forestplot package in R. The plot comes out fine but I am struggling to increase the size ...
0
votes
0
answers
10
views
Problems running accuracy metrics on Validation_Set using fable package
I am unable to let the ACCURACY function point only to the Validation_set. The code perfectly works only in case the first argument of Accuracy is the whole dataset("data_tsibble") but in ...
-1
votes
1
answer
20
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
16
views
Getting "invalid 'type' (character) of argument" error with numeric values when I do apply.weekly(data$x, sum)
I have a time series object and I am creating a list of the variables at different timesteps.
when I do apply.weekly( , mean) it works fine, but when I want to sum the values over a week it gives me..
...
1
vote
3
answers
41
views
Find row in Matrix A which is closest two Matrix B
Lets say I have two matrices A and B given by
set.seed(123)
m1 = matrix(runif(10*5), nrow = 10, ncol = 5)
m2 = matrix(runif(10*5), nrow = 10, ncol = 5)
I want to find for each row in matrix A the row ...
0
votes
0
answers
20
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
29
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
vote
2
answers
30
views
R function 'transform' ignoring argument 'check.names=FALSE'
I'm having issues with the function transform in R and the argument check.names.
For example:
df <- data.frame('A' = sample(1:10), 'B' = sample(1:10), 'C(%)' = NA, check.names = FALSE)
> names(...
0
votes
0
answers
36
views
Conditional variable for COMPLETE DATA [duplicate]
Attached data :
id = c (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
vm = c("12", "13", "14", "15", "16", "17", "18" "19", &...
1
vote
2
answers
25
views
Change the absolute value of elements in a dataframe without changing their sign (+ / -)
I have a dataframe of cumulative changes, which I am trying to convert into (multiplicative) factor values.
If all values were positive, I could simply add 1: e.g. a 25% increase would be 0.25, adding ...
1
vote
1
answer
14
views
Pattern fill in highcharter bar chart
I would like to create a column or bar chart with pattern fill in an R shiny app. It seems to me that highcharts and related highcharter package should be able to do the job, but I could not find a ...
3
votes
1
answer
41
views
In R, how and where does the underlying C functions get their argument inputs?
I'm trying to understand what happens at the C level when I call a function in R. For instance, print("Hello, World!") will call UseMethod("print"). From the "table" in ...
-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 ? ...