Category "r"

Using jupyter R kernel with visual studio code

For python jupyter notebooks I am currently using VSCode python extension. However I cannot find any way to use alternative kernels. I am interested in jupyter

A better way to write dplyr pipes? (without using dollar sign) [closed]

Quite often when using the tidyverse to manipulate data, I come up with a situation like the one below. Can someone explain why option 3 works

Muliple table captions in DT in R

I'm following the example from here: https://rstudio.github.io/DT/ I can get a caption above the table with: library(DT) datatable( head(iris), caption =

ifelse is giving me NAs when I want 0s

I am trying to create a variable using ifelse, and would like the column to be 0 when the condition is not true, but they are showing up as NA. Any tips? df$z &

par('usr') equivalent command for grid?

When grid package is used to plot a figure, I want to find out something similar to par('usr') as in base R graphics. What command can do it? https://r-graph-ga

Reactive bar chart in shiny R

I am trying build a reactive bar chart in shiny app. I have a small table named stats Team wins loss draws Arsenal 533 120 256 Chelsea 489 20

How can I switch values between columns for specific rows?

I was building my data set for some accounting work and accidentally made a mistake. I'd like to switch every instance of a Credit (column journalItemLine_credi

possible to implement two sequential flyTo in leaflet R

I would like to create a Leaflet Map which renders at a default location, at a zoom level of 4, and then when the user clicks the go button, pans from location

How to prevent ifelse statement from clearing out previous data?

I'm trying to import some accounting data to a new software and need to add a debit column journalItemLine_debitAmount and a credit column journalItemLine_credi

arranging multiple plots with cowplot cuts off statistics

When arranging multiple plots from a plotlist with cowplot, the stat_compare_means values get cut off in the grid (see picture). When I am removing the plots ti

libstdc++.so.6: version `GLIBCXX_3.4.26' not found on Linux

I was trying to load Seurat package in rstudio and got this error Error: package or namespace load failed for ‘Seurat’ in dyn.load(file, DLLpath = D

Rstudio Rtools error?? 'Renviron contains invalid lines'

I use Rstudio. I got an error while using Rstudio. It's the same error as in the attached image. I uninstalled Rtools, Rstudio and R and then reinstalled them a

R, Python or Excel. How can I count time range occurrences happening during other time ranges?

Say for example, I want to count how many people are in a room while others are in that room for each day. When that person leaves, I want an updated count of h

Error in new.session() : Could not establish session after 5 attempts

I've been facing in R the error message for days using getSymbols of the quantmod package: Error in new.session() : Could not establish session after 5 attempts

How to send emails with delayed delivery in Outlook from R?

Using the RDCOMClient package in R, I am sending a series of automated emails from R. The emails need to be sent at a specific date and time, but I cannot figur

R markdown results='hold' but for messages?

I have functions outputting multiple messages in my code and I can't get these messages to be in the same output chunk, like with results='hold'. As of now, th

How to filter for variables in a column of one df from another df's column with unequal length in R?

I am trying to select for variables in a column of a DF using the variables from a column in another DF with different length. I am using Dplyer to filter. DF1

What is the best way to convert flexdashboard to a Shiny (ui, server)?

I have a flexdashboard application and I would like to convert it into two parts: ui and server. Is there any way (functions or workaround) to do this? A simple

download data from CoinMarketCap API

I want to download coinmarketcap of cryptocoins data. When compiling the code below: rm(list = ls()) cat("\014") library(httr) library(jsonlite) library(tidyver

Install R packages from the command line

I need to build a reproducible R installation from the command line. Seems easy enough, so I created a file with my package names of interest, for example pac