Category "r"

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

Hot to get clean polygons in R after st_combine/st_union with sf package?

I have a tidy dataset for census sectors in sf format (setores_sp_ok.rda), which has polygons for two different territorial models, indicated by variable modelo

R create sf polyline from nested list of coordinates

I have a nested list of coordinates in the following format: feature <- list(type = "Feature", properties = list(`_leaflet_id` = 125L, feature_type = "p

Sending Queries to a table in RMySQL, using R variables

I am trying to write data I have created in R and stored in arrays to MySQL table. Currently this is how I am doing it, for(z in 1:60){ dbSendQuery( mydb,

Replace_na with map function

penguins %>% map(~replace_na(list(.=0))) Why the code above didnt work to replace na in the dataset penguins? The result is below # A tibble: 8 x 1 .

How can I change global fonts in officer

I am trying to make a word document from R. I use the officer package. doc = docx(title = 'test') When I do this, the standard template is used. Is there a w

Clustering longitudinal data with multiple variables in R

I have a dataset that contains the observations of 30 people and each of them had done 20 experiments. Suppose my data looks like this: ID trial reaction r