Category "r"

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

Finding the elbow/knee in a curve

I have these data: x <- c(6.626,6.6234,6.6206,6.6008,6.5568,6.4953,6.4441,6.2186,6.0942,5.8833,5.702,5.4361,5.0501,4.744,4.1598,3.9318,3.4479,3.3462,3.108,2

Passing JSON into R function

I am trying to pass the following JSON into a function in R. The raw JSON { "type": "Polygon", "coordinates": [ [ [-122.68,42.77], [-1

dplyr::select function clashes with MASS::select

If I load the MASS package: library(MASS) then load try to run dplyr::select, I get a error: library(dplyr) mtcars %.% select(mpg) # Error in select(`__pre

Writing ISO8859 data to MySQL in R (error:"could not run statement: Invalid utf8 character string")

I need to import an SAS Transfer File (.xpt) to MySQL. Because I don't own SAS, I tried a) first importing the .xpt in R b) then using dbWriteTable from the li

Calling user defined functions from dplyr::mutate

I'm working on a project that involves many different tibbles, all of which have a period variable of the format YYYYMM. Below is an example of how all my tibbl

Calling user defined functions from dplyr::mutate

I'm working on a project that involves many different tibbles, all of which have a period variable of the format YYYYMM. Below is an example of how all my tibbl