Category "r"

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

what is the new version of NBZIMM package for R 4.1.3

I have been having problems finding old packages for new nersion of R, any help appreciated > install.packages('NBZIMM') Warning in install.packages : pack

How to prevent user from doing anything on shiny app when app is busy

I have a complex shiny app with a lot of inputs, a leaflet map etc ... The problem I have is when the app is busy making some calculations, the users keep on cl

tidyverse: data transformation, gather()

I am trying to transform a dataset: [1]: https://i.stack.imgur.com/09Ioo.png To something like this: [2]: https://i.stack.imgur.com/vKKu2.png How can I do this

ggplot2 : Can't add ` ` to a ggplot object

everyone I generated 2 ggplot figures and I would like now to add them into the same figure, to do that I simply add the +. So I have 2 plots : (1 ggtree and 1

Assigned data `geom` must be compatible with existing data

I am trying to create a simple map of the total number of collisions by county. I will pool the collision across species and then make the fill color dependent

How to highlight significant results in Tukey Test

I am using R in order to create a graph for my Tukey Test after my ANOVA analysis. This is the code: TukeyHSD(my.anova) Tukeytest <- TukeyHSD(my.anova) plot(

R/Rstudio stop working after loading Rcmdr package

I got this problem after installing the new version of Rstudio/R , I had R version 3.6 and Rstudio 1.2.xx and after update I got this .T hen I tried doing a cle

Error in normalizePath(path.expand(path), winslash, mustWork) : path[1]="NA": The system cannot find the file specified

Each time after I open RStudio, the first line of code I enter will result in this warning: Warning message: Error in normalizePath(path.expand(path), winslash

R ODBC DBI error: database does not exist

I'm working on a Mac and trying to connect to my remote Postgres database in R Studio. Error First, the error: Error: nanodbc/nanodbc.cpp:1021: 00000: FATAL: d

Why do terra::cellSize() and raster::area() produce different estimates of raster cell area?

I just noticed that terra::cellSize() produces cell area estimates that do not match those produced by raster::area(). First, why do these two methods not provi

Snowflake error in RStudio which limits the size of rows to fetch - Error: nanodbc/nanodbc.cpp:2695: HY000

I have an issue where I kind of know what it is but do not know the solution to it. When I fetch data from an external Snowflake DB, it limits the size of the d

R Markdown won't knit even though my code chunks work

For some reason, my code chunks work but when I try to knit the file, I have an "object not found" error. Here's the chunk which causes the error: library(ggplo

R - if_else assign na value

I have a dataframe in R. My goal is to create a new column with if_else statement. If the value in a row is equal to the string "company", then the value of thi