Category "r"

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

Improve if else statement

I have the following function in R. It is working fine, however, I think that must be a better way to run this function. values <- c("a","b") print <- f

Shiny Apps, ioslides (or just Rmarkdown), and Github

I have an ioslides/rmarkdown file with an embedded Shiny app. I was hoping to put this presentation on my github account but when I do the app stops running.

Is abind console output incorrect?

I am trying to combine multiple 2d vectors to obtain a 3dvector, the 3d vector should be [rows, columns, 2dvectors]. So far I have only worked with 3d vectors m

Split 600 columns into 2 new columns for each one, with old and new column names in vectors

I want to split 600 columns (listed in a vector) at a delimiter (in this case a /) into 2 new columns for each one (also listed as vectors). I've worked out bas

Pooled-AUC meta-analysis using metafor in R

I'm conducting a meta-analysis concerning prediction studies that report AUC's with CI's. I'd like to create a forest plot that pools the AUC's together. I have

R: Test for serial correlation after having used felm

I would like to test if serial correlation is present in my model. I have a large panel data set and I run the regression with felm and let's call the model fel

Error when using regr() command: undefined columns selected

I get the following error when trying to run the regr() command from the yhat package: Error in `[.data.frame`(new.data, , c(DV, IVx)) : undefined columns se

Extract cells values of a matrix within a circle (in R)

In a matrix I would like to select a cell having a certain value (3 in the following example) and determine the number of cells having a value of 1 and 2, withi

RMarkdown YAML section add author's hyperlink email to footer

In the YAML section of the RMarkdown file, I want write the author's name and email address and have that only appear in the footer of the document. Here is an