Category "r"

Save package settings between sessions

Is there a definitive way to save options or information pertaining to a certain package between sessions? For example say somebody made a game and released it

Importing multiple Excel files with multiple sheets and creating a new column based on sheet's names

I am trying to upload multiple Excels files (same format) and each of these files has multiple sheets, in nature each Excel file has information about a hotel b

Stacking multiple plots, vertically with the same x axis but different Y axes in R

I have a data.frame with multiple time series vectors against a date:time vector. I would like to plot all of the relevant vectors, vertically stacked on separa

targets::tar_map() example? (R targets static branching)

Does anyone have an example of how to use static branching from the targets package (R)? I'm reading targets manual on static branching but I'm having a hard ti

ggplot2: how to color a graph by multiple variables

I am fairly certain I have seen a solution for this somewhere, but as I have been unable to find it, here is my problem. I have some time series data identifi

Making a matrix from lsmeans contrasts return

To create the data frame: num <- sample(1:25, 20) x <- data.frame("Day_eclosion" = num, "Developmental" = c("AP", "MA", "JU", "L"), "Replicate" = 1:5)

Creating a Prompt/Answer system to input data into R

I've created some R code for use by people who know nothing of R (though I'm pretty green myself). I've been having people paste in the initial data to the R co

How do I find most frequent words by each observation in R?

I am very new to NLP. Please, don't judge me strictly. I have got a very big data-frame on customers' feedback, my goal is to analyze feedbacks. I tokenized wo

Sequence construction that creates an empty sequence if lower is greater than upper bound

More than once the "cleverness" of R's seq function has hit me badly in the corner case when lower == upper - 1: > 1:0 [1] 1 0 > seq(1, 0) [1] 1 0 > s

How to Use $ and | Logical operators together In R

=if(OR([a]="1",AND([b]<=50,[b]>0)),1,0) - Excel Formula How Can i Write this as an R code: below is the code which i tried i = 1 for (i in 1: length(

How to Use $ and | Logical operators together In R

=if(OR([a]="1",AND([b]<=50,[b]>0)),1,0) - Excel Formula How Can i Write this as an R code: below is the code which i tried i = 1 for (i in 1: length(

Downloading png from Shiny (R)

I am pretty new to Shiny (and R) and struggling with exporting the plot I make in Shiny to a png-file. I looked at these two threads but could not figure it o

Proper settings for plot.estimateEffect in stm package

The stm package provides an indispensable set of tools for estimating the effect of covariates on topic prevalence. The plot.estimateEffect() function in partic

export list of tables as a object in xlsx file

I want to export tables with captions as a single object into a xlsx file. I have a list of tables and want to save them in a xlsx file. library(dplyr) library(

plot this in ggplot. Controlling y axis line within a range

This is using base, where I can control the x and y axis range, where exactly the line should be drawn. plot(mtcars$mpg, mtcars$hp, ylim = c(0, 400), xlim = c(

Can I specify the dates and times of a time series in R?

I have a dataset that contains times and dates in the first column, and the stock prices in the second column. I used the following format. Time

How to connect RStudio using Shiny to Microsoft 365

I have a lot of googlesheets that i write in and out from using R. We are merging our sheets into Office online(365). How can i connect to the online microsoft

Randomly extract video frames from multiple files

Basically I have a folder with hundreds of video files(*.avi) each one with more or less an hour long. What I would like to achieve is a piece of code that coul

R: is there a pandas function map in R?

I want to map values from a named list in R to a dataframe. Is there a equivalent of pandas map function in R? list = (a=1, b=2) df = data.frame(a) df.map(li

Error in plot.new() : internal read error in PDF_endpage

I'm trying to plot a correlation matrix of my data. Here's my code: data <- read.table("path/to/data", header=T, sep='\t') cor <- cor(data) corrplot(co