Category "r"

Modify a single cell value in dplyr

Let's say I have the following dataset: dat <- read.table(text="id_1 id_2 123 NA 456 NA NA 3

truthTable in Rstudio Error: incorrect outcome specification

I was trying to do a QCA analysis of sufficeny in RStudio 4.1.3. using truthTable command. By running the code i get Error: wrong outcome specification. The out

Connect to Azure SQL - Token Based

I've tried this over on the Rstudio forums and they've suggested i post here/azure support. Azure doesn't seem to be helping right now so if anybody has any sug

Trying to bold y axis in ggplot

I am trying to bold my y-axis. The title for the axis is bold, but I can't seem to figure out how to bold the number themselves. Here is my code so far, combi

Pandas: How to add a grouping variable based upon another column?

I have a dataframe with some id's and some dates. I want to be able to group the id's by their change in date to create a generalized "grouping_variable". In r

Change sparkline coloring in shiny DT table

Below is the code to develop sparkline in R. Wanted to check if we can change the color . I mean the negative values to be black and positive values to be red l

Conditional mutate - creating a new variable with coalesce

I'm scraping data from a website and depending on the structure of the page. I have an inner join in my final table that either joins clean on WON and LOST vari

Can anyone help me with this crontab?

We want to download the stock price of Tesla every day, using the package "quantmod" in R. We managed to write the function that downloads the last available st

Spade in FlowJo v10.0

I have an issue with installing the spade package in R: > source("http://bioconductor.org/biocLite.R") Bioconductor version 3.7 (BiocInstaller 1.30.0), ?bio

Conditional formatting of multiple columns in gt table

This is my first post, so apologies if I messed something up. I am trying to apply conditional formatting to multiple columns (comparing results for samples Sam

Concatenating strings with multiple separators using paste() in R

See the following reproducible example: require(tidyverse) set.seed(1) reprex_df <- data.frame( var1 = sample(1:10), var2 = sample(11:20), var3 = sam

How to grep a string ending in a specific punctuation mark

I'm trying to grep strings that end in a dash in R, but having trouble. I've worked out how to grep strings ending in any punctuation mark, maybe not the best w

File not found error when running Maxent in biomod2

When I run Maxent into biomod2 I got this error: Error in file(file, "rt") : cannot open the connection In addition: Warning messages: 1: running command 'j

"Error in svd(c) : infinite or missing values in 'x'" when using synth() in R

I am using the synth package in R to implement a synthetic control method, where I use the dataprep() function to construct the appropriate matrices to be passe

Equivalent of validation plot in ggplot

I am trying to write the code to plot validationplot {pls}'s equivalent using ggplot. I could make this using base R, but could'nt figure out how to plot thi

Equivalent of validation plot in ggplot

I am trying to write the code to plot validationplot {pls}'s equivalent using ggplot. I could make this using base R, but could'nt figure out how to plot thi

LaTex not findable during rmarkdown render to pdf [duplicate]

I am havng trouble rendering pdfs in rmarkdown. Everything has been working fine until a point yesterday that I started getting this error mes

What are the differences between R's new native pipe `|>` and the magrittr pipe `%>%`?

In R 4.1 a native pipe operator was introduced that is "more streamlined" than previous implementations. I already noticed one difference between the native |&g

r shiny and ggplot2::facet_wrap how can I add categories to facet_wrap without having the original plot resize?

I have a shiny app that lets the user add categories to the facet_wrap. When I start with one category the plot fills the entire box but when I add a second cat

split the lines of a data frame into a variable number of lines based on a character in R [duplicate]

I have this df: df = data.frame(ID = c(1,2,3), A = c("h;d;c", "j;k", "k")) And i want to retrieve a new df with splited rows ba