radioGroupButtons in shinyWidgets only returns default value if only icons...
Description:I’m trying to use shinyWidgets::radioGroupButtons in a Shiny app with icons as the only visible label. But when I click any of the buttons, the value in input$tag always stays at the...
View ArticleApplying conditionals across many columns based on string indicators within...
I am wondering if there is any type of R magic, either tidyverse, or any other, that allows you to apply conditionals on one or more variables that share a common string within each of the column...
View ArticleAlign two separate ggplots at their x axis but keep their y axis independent...
I would like to generate a few different plots in ggplot2 and assemble them in an image tool like MS publisher or Inkscape to get a single publication-ready figure.Ideally, I would like to produce...
View ArticleBin Granges with Gaps
I am try to split Granges to specific n of bins, usually, GenomicRanges::tile could work for this. However, my Granges has some gaps, for example:# if (!require("BiocManager", quietly = TRUE))#...
View Articlecombining flextable formatting of negative numbers with NA and big mark
I havedf = data.frame(col1 = c(NA,10000,-1,0), col2 = 1:4)I would like:have negative numbers surrounded by brackets as mentioned in put brackets around negative numbers flextablehave blank values shown...
View ArticleHow to put brackets around negative numbers in a flextable
I have a flextable composed on both positive and negative numbers.I would like to format the negative numbers to have brackets around them, as opposed to a - sign.ft <- flextable( data.frame(col1 =...
View ArticleHow can I apply formatting to rownames in a flextable?
padding() can be used to add indents to column values. Is there a way to do this with row names?I guess I could add another column and then just modify their position but I wonder if there is a better...
View ArticleHow to activate a page break for a table in MS Word using Officer and...
I am using the officer and flextable packages in R to write reports in Microsoft Word.When I use the body_add_flextable() function, the tables always start on a new page because the "do not separate...
View ArticleMake simplify2array to produce a numeric matrix
I want to bring elements from a list in a matrix using simplify2array and calculate the rowMeans. The problem is that simplify2array produces a matrix, with elements beeing of class list and not...
View ArticleRadar chart not closing the loop
I have been trying to create a radar chart in R that has the values (Average) and its Standard Deviation.I get to make the graph, but not to close the loop. I am using ggplot2 since based on my...
View ArticleAdd values across dataframe columns
I have a dataframe where missingness in indicated by "Z" (there may also be some "z" and NA entries present in the data), and values are entered as characters ("0", "1", etc). I need to create scores...
View ArticleWhy does dredge not show a column for my QAICc values in the output? [closed]
Below is the code I'm using to set-up my model in R and then subsequently trying to use MuMIn::dredge function in R for model selection. For whatever reason, I cannot get R to display the QAICc values...
View ArticleMisaligned sf object in ggplot
I have two sf objects, which when plotting are slightly misaligned.While initially the two objects have different CRS:the first has: WGS 84the second has: MGI / Austria GK EastI proceed, as usual...
View ArticleHow can I multiply specific rows and column values by a constant to create a...
I have a data frame that looks like iris for example. I want to create another column called C1 which is a multiplication of all setosa Sepal.Length by 2.5, all versicolor Sepal.Length by 3.5 and all...
View ArticleHow to get row index number in R?
Suppose I have a list or data frame in R, and I would like to get the row index, how do I do that? That is, I would like to know how many rows a certain matrix consists of.
View ArticleHow to find a conditional mean using R [closed]
I would like to find the mean of wages for males and females. How do i find the compute mean for wages that belong in the female column and for wages that belong in the male column.
View ArticleHow do I subset a data table row in R to get the rows unique to itself
I know this may be a simple question but I cant seem to get it right.I have two data tables data table old_dt and data table new_dt. Both data tables has two similar columns. My goal is to get the rows...
View ArticleIf, else statement issue in r [closed]
I am trying to filter and label three categories: "High", "Low", and "Other" based on two columns, "Metering" and "Taskload".Here is my code:WorkloadCategory <- function(Metering, Taskload)...
View ArticleicenReg::ic_np() returns empty output and plot fails
I'm trying to estimate a nonparametric survival curve using icenReg::ic_np() (Turnbull estimator) for interval-censored data. The event of interest is when infants begin to visually fixate. All...
View ArticleR - adding P12 certificate to get call
I have a successful call in Postman where I access an API with a .p12 certificate. In Postman, the certificate is stored in the global settings.Now I am trying to translate this Postman-call to R-code,...
View Articleggplot unwanted line when combining facet_wrap with geom_segment for...
I want simple wrapped timeseries plots that colour code weekday/weekend line segments. Here's a reproducible example:require(tidyverse)set.seed(42)# toy hourly dataset with daily and weekly...
View ArticleA system with no internet but connects to Artifactory Rworkbench
I have an Rworkbench running which has no access to internet but downloads packages from Artifactory CRAN mirror. How should I have the .Rprofile looking so that it downloads renv and other packages...
View ArticleHow to draw regression line instead of lowess line in `pairs()` in R?...
I'm trying to replace the panel.smooth for argument panel in pairs() with a regression line drawing function instead of lowess line, with no success.I tried to create function reg and place it for...
View ArticleR Google Maps API - optimize google directions by distance
I am using R's Google Maps API googleway. It offers a function called google_directions with a parameter optimise_waypoints, which, if set to TRUE optimizes the route with regards to travel time. In...
View ArticleHow do I solve : Error: object 'a' not found
I 'm running into an error and don't know how to fix it.If I just want to make a vector: kat <- (a, b, c) it trows an error: object 'a' not found.The workspace is empty, I cleaned itwhen I run ls()...
View ArticleError when running lilikoi.featuresSelection() in lilikoi R package:...
I'm using the lilikoi R package to follow a built-in example from the official documentation. While most of the steps work correctly, I encounter an error when Iattempt to run the...
View Articleggplot2 geom_jitter, colors
dotAW <- A_W_pointdotAW <- ggplot(dotAW,aes(x=AASW, y=WW, fill=taxa)) dotAW <- dotAW + geom_jitter(aes(color = taxa), size = 4)dotAW <- dotAW +geom_abline(intercept = 0, slope = 1)dotAW...
View ArticleHow can I parse both of these JSON files in R?
I am attempting to parse JSON files found on the web. From the same source, some JSONs can be parsed and others cannot. What is the difference between these JSONs? How can I parse them both? This is...
View ArticlePlacement of geom_node labels outside vertices with different sizes
I aim to draw a circular network where the labels of the vertices are placed outside the vertices. While this can be done relatively easily for vertices with similar sizes, this is getting more...
View ArticleReading .dat and .dct directly from R
I need to read a .dat file using a .dct file. Has anyone done that using R?The format is:dictionary { # how many lines per record _lines(1) # start defining the first line _line(1) # starting column /...
View Article