Skip to main content

Questions tagged [r]

R is a free, open-source programming language & software environment for statistical computing, bioinformatics, visualization & general computing. Please use minimal reproducible examples others can run using copy & paste. Show desired output entirely. Use dput() for data & specify all non-base packages with library(). Don't embed pictures for data or code, use indented code blocks instead. For statistics questions, use https://stats.stackexchange.com.

r
0 votes
2 answers
26 views

How to Calculate Average Time from First Activity to a Milestone in a User Activity Log Using data.table in R?

I'm working with a dataset of user activity logs and need to calculate the average time it takes for first-time users to reach a specific milestone. Specifically, I want to find the average time it ...
0 votes
1 answer
142 views

Issues with using the API R Code provided by RapidAPI

I'm trying to get the API R code of RapidAPI to work. The code they provide is as follows (schematically): library(httr) GET( url = rapidapi_url, config = list(x-rapidapi-key = API_KEY, ...
0 votes
0 answers
43 views

Resolve conflict between jquery, shiny.fluent, highcharter in r shiny app

I'm completely new to adding scripts.js to r shiny. I'm trying to dynamically adjust height of sidebar dependent on height of main content. So javascript required. Including useShinyjs() in my UI,I ...
-1 votes
1 answer
525 views

R Shiny error for data scrape web app "number of items to replace is not a multiple of replacement length"

I am attempting to make a shiny web app using a function that I found to scrape data off of a NOAA website. So I did not create the function, but I have used it and it works well. I want to create ...
0 votes
1 answer
41 views

sumifs with a criteria

Here is my data. iris.dt<-as.data.table(iris); And this is exactly what I want, and it works fine. iris.dt[,Sum.Petal.Width := c(sum(Petal.Width),rep(0, .N - 1)), by = Species]; Output to verify: ...
0 votes
0 answers
15 views

compiling errors for R 4.4.1 on alma linux 9.4

I am compiling R 4.4.1 from source on alma linux 9.4 (docker container) ./configure --prefix ${installdir} \ --enable-year2038 --with-cairo --with-x --with-libpng --with-jpeglib --with-libtiff \ ...
0 votes
1 answer
32 views

GBM in R, links and offsets for Poisson distribution (possible to generalize to any distribution)

My objective is to apply a gbm to predict the frequence of events, which were subject to exposure and assumed to be dependent on many registered features/variables. Since this is a count response ...
0 votes
2 answers
526 views

Exporting citation of a journal article using R

I want R to: Go THIS page. Select "Bibtex" as Format, "Citation and Abstract" for "Export type". Press "Submit" and download the citation file to a designated folder. Is it possible? How can I ...
0 votes
0 answers
5 views

R: running a mirai_cluster via parallelly::makeClusterPSOCK

my goal is to perform some heavy computation in R on a cluster of several Linux hosts, using docker containers. Within R I want to use foreach. To do this, I believe the best approach is with the ...
0 votes
0 answers
10 views

How to obtain standardized residuals for clustered data in lavaan?

I am facing a problem concerning the output of standardized residuals for a fitted lavaan (sem)-object. As far as I do not include “cluster = ” in the fitting function, I can easily obtain the ...
0 votes
0 answers
58 views

Complex lon/lat format manipulation

I originally developed a model to work with a df as df1_ref. Now, I found more data I need in a different format as df2. df1_ref: id country point_id lon lat value_A ...
0 votes
4 answers
37 views

Error when using bind_rows where one data frame has a column of type <hash>

I want to bind rows from two different data frames where one data frame contains a column of hash values whereas the second data frame doesn't contain this column. library(tidyverse) library(openssl) ...
2 votes
4 answers
70 views

Create Vector from One-to-Many Dataframe in R

I have a dataframe with a one-to-many relationship where the one in the relationship are the column names and the many in the relationship are entries in the first column. I would like to create a ...
0 votes
2 answers
397 views

Bayes Factor values in the R package BayesFactor

I've followed the instructions on how to run a Bayesian 't-test' using default priors in the BayesFactor package in R. Some of the returned values are astronomical. Here is an example comparison ...
3 votes
2 answers
48 views

compress files in R without structure of directories

I want to compress some files in R using tar(). My code is quite simple: f <- "C:/TEMP/tarfile.tar.gz" files_to_compress <- dir(path=tempdir(), full.names = TRUE) tar(tarfile = f, ...

15 30 50 per page
1
2 3 4 5
33887