Category "r"

Plotting value from matching complete pairs in rows

I have data of drug concentrations (DV) that include a parent drug and its metabolite, coded DVID 1 and 2, respectively. They are provided to me as separate ro

download data from site

I am trying to download stock prices from yahoo of several shares at once using R loops. I tried the following code, and it produces results but I would like th

Randomize items in rmarkdown transparently

I have the following rmarkdown document: --- title: "Untitled" output: pdf_document date: '2022-04-28' --- ```{r setup, include=FALSE} knitr::opts_chunk$set(ec

If the number of rows in a group exceeds X number of observations, randomly sample X number of rows

I need to reduce the number of rows in a data set. To do this my strategy is to the number of rows in a group exceeds X number of observations, randomly sample

How to return the range of values shared between two data frames in R?

I have several data frames that have the same columns names, and ID , the following to are the start from and end to of a range and group label from each of the

How to plot a Sequential Bayes Factor as participants are added

I am currently analyzing eye-tracking data using the Sequential Bayes Factor method, and I would like to plot how the resulting Bayes Factor (BF; calculated fro

Plot percentage change figure with 95% CI and stats

I am planning to reproduce the attached figure, but I have no clue how to do so: Let´s say I would be using the CO2 example dataset, and I would like to

Rename several columns using start with in r

I want to rename multiple columns that starts with the same string. However, all the codes I tried did not change the columns. For example this: df %>% renam

Could not convert Tex math in Rmarkdown

I am trying to write an algebraic equation in Rmarkdown but its rending as text as opposed to an algebraic equation. The warning below for reference; [WARNING]

Change plot size of rglwidget in shiny

I would like to stretch these plots to the window size or at least make them bigger: ui.R options(rgl.useNULL = TRUE) library(shiny) library(rgl) shinyUI(flui

Loops: How can I loop case_when function in R?

Here's the code, where I am trying to create a variable by detecting the words and matching them. Here I use dplyr package and its function mutate in combinatio

Creating a purrr map equivalent

I have a list of files like so: dput(files) list(ped_cv_outcomes_in_hospital_code_v20.csv = structure(list( icd_10_cm_code = c("I2101", "I2102", "I2109", "I

R Plotly how to link text to bubbles in order to remove it when click on legend

With plotly on R, I have a bubble scatter plot and I want to add black text on each bubble. I also have my bubbles colored following a column of my data frame (

Shiny app file upload is substantially slower on different machines

I have a shiny application that takes a file upload, calls a script that processes the uploaded file, and writes 4 csvs as output. The app works but as the titl

Trying to resolve Java issue when running Tabulizer in R

I am trying to extract tables from pdfs in R using tabulizer, and keep getting this error when I use extract_tables. Error in .jcall("RJavaTools", "Ljava/lang/O

How to run AIC on anova output from different models

This is my small subset of data on which anova is used. dput(c) structure(list(Mouse.ID = c("DO.1307", "DO.1309", "DO.1311", "DO.1312", "DO.1316", "DO.1318", "

how to convert lmd file to csv? [Flow Cytometry data]

lmd file extension is often used for generating flow cytometry data. But this couldn't be directly used for processing either in R or Python. Is there a way to

R 4.2.0 doesn't start in RStudio (Windows 11)

R 4.2.0 does not start in RStudio. Attached is the screenshot. It says, "The R session process exited with code - 1073740791" R 4.2.0 starts normally outside RS

Is the R function for dividing dual y(mutiple) in time-series graph?

I'm trying to plot graph that dual y according to concentration(ppm, temperature etc.) Reference data is here. Using this data, i want to make graph below. In

renaming a 7zip extracted folder error Access i denied R

I extracted a TxtinOut named folder using the following cmd in R shell('7z x D:/Region02/test.7z -oD:/Region02 -r -y') I want to rename this folder TxtinOut t