Category "r"

Recognizing and Clicking Alert with RSelenium

I'm having some difficulty with an alert I receive during a for loop. Effectively, I can't figure out how to recognize the alert when it comes up and then close

R: unzipping large compressed .csv yields "zip file is corrupt" warning

I am downloading a 78MB zip file from the UN FAO, which contains a 2.66GB csv. I am able to unzip the the downloaded file from a folder using winzip, but have b

Install R packages using docker file

I have installed R using below line in my docker file. Please suggest how do I specify now packages to be installed in my docker file. RUN yum -y install R-cor

Is there an option type?

This language being multi-paradigm, I wonder if there exists an Option type in R (Some/None), natively or in a package. It would be similar to F#, or to C# null

Overlaying jittered points on boxplot conditioned by a factor using ggplot2

I am making a boxplot conditioned by a factor similar to this example: p <- ggplot(mtcars, aes(factor(cyl), mpg)) p + geom_boxplot(aes(fill = factor(am)))

Suddenly error 'Cannot create a RasterLayer object from this file.' in script that worked before

I have a script where I read a raster stored as .tif : f_treecover <- raster('Landcover_data/treecover_res_100_q.tif') The script used to run fine

replacing missing values in r

I need help in replacing missing values in the following dummy file. The following rule need to be followed when replacing a missing value. If the value is the

Adding directional indication to flow map in R

I'm just getting started on visualising data with R. I've been working on creating a flowmap based off lats and long data from origins and destination of vario

How to change text color in Quarto slides?

After adding CSS style colour as green The editor is making Heading 1 green but in the RStudio slide Preview, the text followed by Heading 1 is green but not th

RStudioServer - load/upgrade preferred set of packages to default sys path (/opt/R/4.2.0/lib/R/library) from R shell

Though an 'old guy' in unix world, I've little experience with RStudioServer and R, acting here as an 'admin' for a shared server for statisticians on a cancer

Creating a Leaflet map in code workbook in Foundry

Anyone created a leaflet map in Code Workbook using r-Leaflet? I have a functioning script that runs (also double checked in R) but how do I get it to visualise

R flextable - How to add a table-wide horizontal border under a merged cell

Is there a smart way to have a horizontal border table wide when you have merged cells? (In the example below, it is not yet table wide). Or should I write a f

R datatable rotate header not aligning

I am trying to rotate the header for a datatable. I was able to rotate the header but the rotated header is not aligning with the columns. This is what I have n

How do I change the directory displayed in the RStudio file pane / navigator using code?

I am writing an R package for a lab notebook. One function makes a new directoy with some Rmd files, opens the files with file.edit, and changes the current wor

R: Panel Data: calculating mean and median of variables based on date / dummy variable

So i am analysing fund panel data. I estimated a fixed effect model with double clustered error terms along the identification (ISIN) and (Date). Each fund has

Why does lm generate NA for each independent variable?

I tried to make a linear regression with the lm function, but the output is NA for every independent variable. The dataframe is numeric. I have already tried t

How to avoid margin references being placed on top of each other in quarto

Quarto is designed to supercede Rmarkdown. It supports many languages and offers new features. One new feature is the ability to place citations and other conte

Making neural network training reproducible using RStudio's Keras interface

I'm trying to make neural network training reproducible using RStudio's Keras interface. Setting a seed in the R script (set.seed(42)) doesn't seem to work. Is

R not attached in VS Code on Win10

I am recently switching from RStudio to VS Code. I have installed R extension in VS Code, but when I open VS Code and R terminal, R cannot be loaded. I followed

Scalable/Iterative Large Data Frame Dimensionality Reduction R

I often have truly large data frames (ie 10 to 40 columns, millions to hundreds of millions of rows) that I would like to perform dimensionality reduction on in