I'm doing some analysis and I had to impute some values. To do so, I write this chunk of code: A) set.seed(1) for (i in 2:length (Dataset[-c(8,11)])) { D
I have a simple long df where every element in the fi column should be a new column in the wide df. So the new df should have 10 columns A:J. The wide df should
I started a new project in Rstudio and selected the option to use renv. The first thing I did was type the command install.packages('sf') and R returned the mes
I once again have a question about the kwic() function from the quanteda package. I want to extract the five words around a specific keyword (in the example bel
Simplified example of a text i have after importing with readlines: text <- c("just", "stuff", "nothing", "interesting", "date", "06.05.2022", "number", "1/
I'm applying WGCNA to RNASeq data following this tutorial. For several functions it give me an error that the package functions are not found. > sft <- pi
I am currently trying to apply parallelization with the gmapsdistance package (driving mode = bicycling) to speed up the computation of the for loop that contai
I am trying to create summary tables. I want to split these by site and have a "Total" column. However, when I try to rename multiple columns AND use add_overal
I have a dataframe events with xy-coords of unique points. I have a dataframe all_nodes with xy-coords of network nodes. All points of events are also in all_no
Given a matrix like mat > set.seed(1) > mat <- matrix(rbinom(100,1,0.5),10,10) > rownames(mat) <- paste0(sample(LETTERS[1:2],10,replace=T),c(1:nr
Consider this function plus_x: y <- 1 plus_x <- function(input, x = y){ return(input + x) } here the y default-value for x is evaluated during the fun
I'm wondering if there is a better way is to get linear regression coefficients as columns in dplyr. Here is some sample data. mydata <- data.frame( S
I've requested an access key and set it. Sys.getenv("EBIRDST_KEY") returns the correct key. ebirdst_download(species = "Sharp-tailed Grouse") returns an error
I have a shiny app on RStudio's free shiny server that uses a fair number of libraries which results in a slow calculation time. The time for the UI to load is
Can somebody help me how can I calculate a probability p from the Poisson equation (programming in R)? I know that there is the ppois function, but I'm not sure
I have two (NPP_BEGA and ENACT_BEGA) stacked raster dataset. They have the same spatial resolution, extent and dimension. I want to run and map the correlation(
I would like to change the resolution of a raster. For example, let’s take this Landsat 7 images at ~ 30m resolution. library(terra) #> terra 1.5.21 f
I have a simple piece of code that tries to publish a table which colours columns according to the colour listed in the contents using the package gt. df <-
I am trying to get the daily mean and maximum values for each pollutant. For each of the monitoring stations, the daily mean and maximum values of each pollutan
This "R code" works fine in Jupyter but not in lab: library(IRdisplay) display_html( ' <script> code_show=true; function code_toggle() { if (code_s