Category "r"

Extreme Bound Analysis (EBA) using ordered Probit in R

I am using Extreme Bound analysis (EBA). my dependent variable is ordinal. So i want to use ordered probit regression for computing EBA. I am using following co

R: Correct Way to Calculate Cosine Similarity?

I am working with the R programming language. I have the following data: text = structure(list(id = 1:8, reviews = c("I guess the employee decided to buy their

How to initialize workers to use package functions in parallel

I am developing an R package and trying to use parallel processing in it for an embarrassingly parallel problem. I would like to write a loop or functional that

Discriminant Analysis (FDA and MDA) plots in R

I am trying to plot the results of Flexible discriminant analysis(FDA) and Mixture discriminant analysis(MDA) using the mda and ggplot2 package. I did it for Li

RStudio fatal error when loading tabulizer

I recently updated R to version 4.2.0 on my Windows 10 PC. When I try to load the package tabulizer, RStudio crashes and the bomb icon with the correspondent "R

Exchange NA with mean of previous and next value

I searched for an answer to how to exchange NAs with the mean of the previous and next values in a DataFrame for specifically one column. But I didn't find an a

unzipping gz file in R

Some R code that used to work to download and unzip .gz files from PubMed is no longer working. Here's a reproducible example: filez = "pubmed22n1148.xml.gz" ur

How I can Speed up code built using purrr- Why is Furrr slower than purrr

I'd like to know if there is a way to speed up a code built with purrr package. I tried to convert it into furr and use the multisession option, but it is even

Knit PDF Output with CAT in R

I am using CAT command in R to get following output. The Output in knitted PDF file is different to what I get in console. How can I get similar output in PDF a

How to speed up collect() from a dbconnect database

I'm reading tables from an odbc driver on an amazonaws server. I am using R 4.0.0 on a 64 bit windows computer. Working from home and using company's VPN so my

Error in cut.default(y, breaks, include.lowest = TRUE) : invalid number of intervals

I use Iris dataset to build a neuralnet model. My goal is to use the caret package from R to predict the species class of various Iris flowers. I try to train m

Difference in legend position between ggplot and ggplotly?

I find out an interesting and strange difference between the same chart in ggplot and ggplotly income_gap_chart <- ggplot(income_gap, aes(x = Country, y = Pe

how can I remove some NA rows but not all of them

I have multiple data frames with information about listed companies from the year 2000 So I want to put them in a list (lets call it df) because I want to do re

How to create my own binomial coefficient function in R

I have created a factorial function which is then used to create a function for the binomial coefficient. My factorial function works but the binomial function

How to set the parameters grids correctly when tuning the workflowset with tidymodels?

I try to use tidymodels to tune the workflow with recipe and model parameters. When tuning a single workflow there is no problem. But when tuning a workflowsets

How to plot wind vectors on wind map

I have NAM wind models that I create map from but I am struggling to add average wind direction vectors. How do I convert the U and V vectors so they give avera

Recode values by function()

I have one quest (pretty short). I shoud recode variebles with function(). I tried some, but it doesn't work still. It should work with this: recode.numeric(x =

data partitionning function CreateDataPartition cross validation problem

I am trying to get predictions of a multiple variables model, its eplt, its made of 7 scores and one final exam score moy_exam2, I want to predict the later usi

Issue with corr.test() results

I am running corr.test() to look at potential correlations between genes and bacteria in a dataframe using this code: spearman=cor.test(FullSet$counts.Bac, Full

Write data frame to Excel file stored in Microsoft Teams using Graph API

I am new to working with APIs and especially MS Graph API so please excuse my ignorance. I work with data in R which is similar to Python, I have a data frame w