Display elements, instead of just counts, within each circle of a Venn diagram?

For example, set A={a,b,c} and set B={b,c,d} and the intersection of sets A and B should be {b,c}. But how can I display {b,c} instead of the count 2 in a Venn diagram? I tried venn in the limma...

Select column 2 to last column in R

I have a data frame with multiple columns. Now, I want to get rid of the row.names column (column 1), and thus I try to select all the other columns. E.g., newdata <- olddata[,2:10] is there a...

Installing R with Homebrew

I'm trying to install R using Homebrew. I ran these commands which are recommended elsewhere on SO: brew tap homebrew/science brew install R For brew tap homebrew/science, I'm receiving this...

How to use Aggregate function in R

can you help me please how to properly use aggregate function in R? I have data like this: SPORT FLOWS [1,] "Other" "1" [2,] "Other" "1" [3,] "Other" "1" [4,] "Other" "1" [5,] "Other2"...

How to assign a specific color to NA in an image plot

I am using the image command to plot a matrix, the matrix contains some NA values. I am using image like image(figData, zlim = zRange, col = colors, useRaster=TRUE) zRange is smaller than the...

R: get list of files but not of directories

In R how can I get a list of files in a folder, but not of the directories? I have tried using dir(), list.files(), list.dirs() with different options, but none of them seems to work.

Convert cartesian angles to polar / compass / cardinal angles in R?

This is a problem that I fought with for a bit and couldn't find a good answer out there. I did eventually solve it in R, but thought I would post it anyway in case others need it. If anyone has a...

Convert .xlsm to .xlsx in R

I would like to convert an Excel file (say it's name is "Jimmy") that is saved as a macro enabled workbook (Jimmy.xlsm) to Jimmy.xlsx. I need this to be done in a coding environment. I cannot...

How to write summarySE function in R

I'm a new R user and want to make a line chart with std using ggplot. For this I am using the summarySE function. vrn1_summary<-summarySE(data,measurevar = "vrn1",groupvars =...

Seeking 2D version of approxfun()

I am seeking in R a 2D version of stats::approxfun() that can generate an interpolation function f(x,y) from an (x,y,z) dataset. I have not found one in the package akima or elsewhere.

R Converting from datetime to date

I have to do a difference between dates and return the number of days. the format of the dates is as follows: 12/9/2011 12:00:00 AM Does anyone know how to perform the difference without using...

Transform a dataframe to use first column values as column names

I have a dataframe with 2 columns: .id vals 1 A 10 2 B 20 3 C 30 4 A 100 5 B 200 6 C 300 dput(tst_df) structure(list(.id = structure(c(1L, 2L, 3L, 1L, 2L, 3L), .Label =...

How can confidence intervals be numerically visualized in corrplot()?

In corrplot(), is it possible to visualize confidence intervals numerically below the coefficients? library(corrplot) M <- cor(mtcars) cor.mtest <- function(mat, conf.level = 0.95){ mat <-...

Convert fullwidth string into halfwidth string by r

How can I convert Ab9876543210 into Ab9876543210? IS there a solution by regular expression? Thanks. test <- dput("Ab9876543210")

Hide and show sidebar panel in shiny

My shiny app has 3 tabPanel in mainPanel, each tabPanel has their own sidebarPanel. I use shinyBS to set sidebarPanel "show and Hide" bsButton("showpanel", "Show/Hide sidebar",icon =...

How to use R to scrape financials from Yahoo Finance

I am interested in analyzing the balance, income and cash flow statements from Yahoo Finance for multiple tickers using R. I have seen that there are R packages that pull information from Yahoo...

Rtsne: Perplexity is too large

I am trying to use tSNE on a gene expression matrix that has the following dimensions: 7x5000. I have removed low variance, low expression and duplicated values: ENSMUSG00000022037...

R ggplot labels on stacked bar chart

I have data that I need to put into a stack bar chart but when I add the labels of the counts some of the labels are above the category and some are under the category. I tried modifying position...

rasterFromXYZ() Error in rasterFromXYZ() : x cell sizes are not regular

I am trying to plot points from a df (xyz/latlonvalue) as raster over a geom_sf shapefile. I tried the answers from another post but none of them helped. The data structure is below. First I try...

Using Rstudio with Docker compose and passing environment variables to rstudio user

I am using docker-compose to create a rstudio service which will be integrated with other services such a db. I am trying to pass some environment variables from the docker-compose.yml file to...

Installing R Studio with Anaconda

I tried to install R Studio (version 1.1.456) using the anaconda navigator by simply clicking on the install button. It was taking more than an hour, so I just figured it should be stuck. I then...

R: cannot run specific cmd code that converts .xls to .xlsx

Long time reader, first time writter... Im writting some R code that shall take some data input from other sources. One place can only give data as a .xls format. While there is good excel...

How do I get correct encoding from my Postgre table when using st_read from the sf package in R

I want to read a table from my Postgre database (default encoding UTF8) and since it actually is a PostGIS table I am using the st package with st_read. test_sf <- st_read(con, stringAsFactor =...

Shiny: How to change the page/window title in Shiny?

There are numerous posts regarding changing titles of other pieces of Shiny apps,...

Calculate marginal effect of dummy (and its standard error) for Tobit in R

I have a standard Tobit model where the only explanatory variable is a dummy for treatment (plus the intercept), and I want to estimate the marginal effect of this treatment on my dependent...

Shell PATH to R under macOS Big Sur

I have a problem with R CMD under Big Sur. I installed R via default .pkg (not via brew) and I have been using zsh (Z shell) as the default shell. I think that I have a problem with PATH that I am...

How to rotate 3D Plotly continuous for R shiny App

I am trying to create a constant rotating 3D scatter plotly so that I can put it in my R shiny app. However, I can't seem to get it to constantly rotate (like this:...

Can I save an Excel Workbook as a binary file using R?

In R I am trying to save an Excel workbook as a binary worksheet (.xlsb) instead of the standard (.xlsx or .xls) method. Using packages like openxlsx or xlsx do not work because they do not...

How to write raster bylayer using terra package in R?

I want to write rasters by layer using terra package. I am using the following code library(terra) # first create a raster r1 <- r2 <- r3 <- rast(nrow=10, ncol=10) # Assign random cell...

accessing the original file name of r markdown parameters file

I want to provide the user a convenient way to define the input file. For this I am using the parameters functionality in markdown. If I "knit with parameters" I get asked for the input file. Is...