Category "r"

metafor: use of annosym argument in addpoly()

I draw a forest plot with non-default annosym values: res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, measure = 'OR', method='DL', slab=p

How can I use a vector variable to avoid repeating references to non-adjacent columns in R?

Question In R, can I used a vector that holds the names of data frame columns to avoid repeated code? vec_columns <- c("col1", "col2", "col8", "col54") Bac

Ggplot2 rearranges wrongly the bars in a plot bar when value is null

Given the following data, I compose a data frame with a factor and a numeric column. X2 <- c(4,4,3,5,4,4,2,3,4,3,5,5,4,3,3,4,2,3,3,4,3,5,3,3,4,4,3,3,5,4,5,4,

Loading some packages with Rstudio server does not work, while it works with R server

I am using Rstudio server on a remote server and I have some packages already installed. When I try to load libraries like raster or terra using Rstudio server,

Using findElements() in the RSelenium package to select multiple dropdown items and using clickElement()

I am trying to use clickElements() from the RSelenium package in order to drop down all of the downwards facing arrows in the "distrito" dropdown panel. I can d

dplyr case_when throws error names' attribute [1] must be the same length as the vector [0]

I am running the following case_when inside a dplyr chain: open_flag = case_when ( open_flag == 0 & (click_flag > 0 | mirror_flag > 0) ~ 1, TRUE ~

Problem with `mutate()` input `index_date` when performing time series xgboost in R

here my reproducible example mydat=structure(list(supplier = c("TKP", "TKP", "TKP", "TKP", "TKP", "TKP", "TKP", "TKP", "TKP", "TKP", "TKP", "TKP", "TKP",

How to get all transaction from an address via the etherscan API in R?

I've been looking for a way to download all transaction from a specific contract since their start up until now. It's around 25k transactions as of today. I've

Using Dplyr to calculate percent by group for every column without specifying the name?

This is similar to this. However what I'm interested is to calculate the percentage for every column. So for example when I do the below I can calculate column

How to remove pairs of rows corresponding to same value in R dataframe?

For the unique pair of ID, if both corresponding rows are 0, I need to remove them. In this case, remove row #5 and #6 but not row #7 and #8. tmt.pair <- c("

Using `pool` in an R Shiny package

How can I implement the use of a pool object in an R Shiny application structured like a package? I have structured my package according to the layout described

Convert string into binary vector in R

I'm trying to clusterize a set of journals by descriptors and I've been thinking of turning descriptors into a binary vector instead of using string distances (

Organize columns with numerical info in colnames via dplyr relocate

I have a large amount of annual data in a data frame that will only get larger. I would like to organize it, grouping columns according to the year, which is

information on .o files for x64 is not available: NOTE on R package checks using Rcpp

I am using windows and just updated to R 4.0.3 (with RStudio to 1.3.959) and ran the R check for one of my packages which uses Rcpp and RcppArmadillo and I got

rpivottable: drop down lists open in wrong position

When clicking on drop down arrow, near grouping categories, the corresponding list opens on top of the page. (At first I thought it didn't work at all.). The co

syntax error near unexpected token in jupyter terminal

I write a r script below and want to run it in jupyter terminal. But it shows error: ./Rda_to_csv.r: line 1: syntax error near unexpected token `(' ./Rda_to_csv

Remove part of string after "."

I am working with NCBI Reference Sequence accession numbers like variable a: a <- c("NM_020506.1","NM_020519.1","NM_001030297.2","NM_010281.2","NM_011419.3"

Remove part of string after "."

I am working with NCBI Reference Sequence accession numbers like variable a: a <- c("NM_020506.1","NM_020519.1","NM_001030297.2","NM_010281.2","NM_011419.3"

Traverse a link tree for Shiny dashboard

I am making an interactive Shiny dashboard with typical "drill-down" capability. There are hundreds of thousands of links in the database. I am working on takin

if values of a column is in between two columns in R, populate a new column

I have two data frames of different lengths, like : df1 locusnum CHR MinBP MaxBP 1: 1 1 13982248 14126651 2: 2 1 21538708 2