Category "r"

Asterisks in the output of R describe function

What does it mean the asterisk next to some item names in the descriptive statistics table given by describe function (package psych) in R ?

How to project a new data row onto PCA space using dudi.mix in R?

I have a mixed dataset (comprising continuous, ordinal and nominal variables) that is high-dimensional (with more variables than rows). I want to perform a mixe

Having Problems Plotting a 3D Map in R

I am having problems plotting a 3D map in Rstudio. Here is the code I used; plot_ly(myLocalClean, x = ~date, y = ~median, z = ~sales, opacity=0.5) #3D my resul

Extra learners in mlr3 [closed]

I cannot use models in mlr3 other than random forest, part, knn, svm, gbm etc. I am using mlr3extralearners package but still it seems there a

R table function not showing zeroes

I'm kind of ignorant on the topic so it might be a simple mistake, but I have used cutpoints and then i'm trying to print a table with the sum of elements in ea

How to add fileInputs into DT

I need to add a fileInputs to each row of a table. Unfortunately, this widget does not work correctly, unlike regular actionButtons and other elements. The wind

Compute and display mean of dependent variable in modelsummary output tables in R

I am using the feols command from the fixest package in R to estimate fixed effect regressions, in most cases with weights. In order to output my results, I am

I am having issue running this r code. I am trying to use ANN classification model to classify one variable using the other variables

this dataframe is about Farmers Risk attitude. I want to classify Risk Attitude, using Risk drought in Artificial Neural Network model. x=data.frame(x$Riskdroug

Plotting value from matching complete pairs in rows

I have data of drug concentrations (DV) that include a parent drug and its metabolite, coded DVID 1 and 2, respectively. They are provided to me as separate ro

download data from site

I am trying to download stock prices from yahoo of several shares at once using R loops. I tried the following code, and it produces results but I would like th

Randomize items in rmarkdown transparently

I have the following rmarkdown document: --- title: "Untitled" output: pdf_document date: '2022-04-28' --- ```{r setup, include=FALSE} knitr::opts_chunk$set(ec

If the number of rows in a group exceeds X number of observations, randomly sample X number of rows

I need to reduce the number of rows in a data set. To do this my strategy is to the number of rows in a group exceeds X number of observations, randomly sample

How to return the range of values shared between two data frames in R?

I have several data frames that have the same columns names, and ID , the following to are the start from and end to of a range and group label from each of the

How to plot a Sequential Bayes Factor as participants are added

I am currently analyzing eye-tracking data using the Sequential Bayes Factor method, and I would like to plot how the resulting Bayes Factor (BF; calculated fro

Plot percentage change figure with 95% CI and stats

I am planning to reproduce the attached figure, but I have no clue how to do so: Let´s say I would be using the CO2 example dataset, and I would like to

Rename several columns using start with in r

I want to rename multiple columns that starts with the same string. However, all the codes I tried did not change the columns. For example this: df %>% renam

Could not convert Tex math in Rmarkdown

I am trying to write an algebraic equation in Rmarkdown but its rending as text as opposed to an algebraic equation. The warning below for reference; [WARNING]

Change plot size of rglwidget in shiny

I would like to stretch these plots to the window size or at least make them bigger: ui.R options(rgl.useNULL = TRUE) library(shiny) library(rgl) shinyUI(flui

Loops: How can I loop case_when function in R?

Here's the code, where I am trying to create a variable by detecting the words and matching them. Here I use dplyr package and its function mutate in combinatio

Creating a purrr map equivalent

I have a list of files like so: dput(files) list(ped_cv_outcomes_in_hospital_code_v20.csv = structure(list( icd_10_cm_code = c("I2101", "I2102", "I2109", "I