Category "r"

Formatting the elements of a panel

This is a snippet of my interface (if choices = c () it means that the choice is managed on the server side): sidebarPanel( selectizeInput( "s1",

extract_parameter_set_dials() fails for self-written gbm engine for boost_tree()

I followed this vignette of the tidymodels package to make the gbm an engine for the boost_tree() function. I came up with the following for regression tasks: l

Calculation between vectors in nested for loops

I am struggling with an issue concerned with nested for loops and calculation with conditions. Let's say I have a data frame like this: df = data.frame("a" = c(

Pivot Longer in R Issues

I've looked quite a few different questions on here around Pivot Longer but I can't seem to figure out how to get my scenario to work. For example R Pivot multi

Column name being duplicated in recipe

This is the piece of code i'm having troubles with: pump_recipe <- recipe(status_group ~ ., data = data) %>% step_impute_median(all_numeric_predictors()

Randomizing within and across groups using group_by and sample

I'm running a study in which each participant will be presented with stimuli that have been randomized at two different levels: blocks (3 unique blocks) and tri

How do I fix this error for reticulate in Rstudio?

I searched Stack Overflow for fixes to this error and will put all the things that I have tried below that did not solve the issue. I have not had an issue on o

Add specific hovering behaviour to R plotly graphic

I am having troubles defining a specific behaviour when hovering an R Plotly graphic. Here is what I would like to do : I would like the full arrow to be respon

How to have a single download button for all datatables in R shiny webpage

I am working with a shiny app where it is desired to have a single downloadButton in the header of the application that downloads the data table present in the

fast partial match checking in R (or Python or Julia)

I have two dataset with names and I need to compare names in both datasets. I just need to keep the union of the two datasets based on the names. However, a nam

How would I create a subset by matching multiple patterns at a specific location in column names?

Sample code using dput: df <- structure(list (TCGA.OR.A5JP.01A = c(0.0980697379293791, NA, NA,0.883701102465278, 0.920634671107133),

Cobalt love.plot has asymmetric error bars that I cannot remove

I have a quasi-experimental dataset with two groups and two assessments (pre-intervention and post-intervention) that has a little bit of pre-test missingness (

How to read a textfile line by line in R and search for a special string?

I've got thousands of textfiles which 10-thousands of lines in different structure in a textfile. It looks like the following 3 lines: DATE#2020-10-08#TIME#16:0

Issues with accent when using the "separate" function from tidyverse

I am using the separate function from tidyverse to split the first column of this tibble : # A tibble: 6,951 x 9 Row.names Number_of_ana

How to send query with variables from Rstudio to Mongo database?

I'm trying to send query to my Mongo database depending on a variable producted in my R code. Unfortunately, Mongo query needs double quotes and the function "p

Flatten nested list and retain all parent keys for each bottom-level element

I need to flatten an arbitrarily nested list to a data frame and retain the path of keys / indices in one column, while extracting each element on the bottom le

How to flag time-varying indicators with overlapping dates in a longitudinal data set?

I have a simulated data set with 5 rows, each representing a block of person-time, each with its own start and end date ('start' and 'end'). Each row has a visi

Is it there something wrong with tensorflow?

Hello I have being using tensorflow and keras for a while. I use this packages to build neural networks. As I work on CPU I was used to recive a message like th

Editable Table functionality in R-Mobile Shiny

I see that datatable works well with Shiny web to have editable cells or rows/columns. They are caught using cell_edit events. But I cant find a similar thing f

Apply smoothing (get.smooth, smooth.spline)

Data set looks like this head(tcata.df) X NJ stimulus factor_attribute time_0s time_1s time_2s time_3s time_4s time_5s time_6s time_7s time_8s time_9s time_10s