Category "r"

Assigning different types of tasks to the same `foreach` loop

Many are familiar with foreach() to assign a loop across many cores in parallel using %dopar%. However, in R how do you send a single job request for a variety

mixed effect model with more than two uncorrelated random effect slopes in python

I have multi-level data and want to fit a mixed-effect model in python due to parallelization potential. But I am not able to compile the formula in 'statsmodel

Configuring compilers on Mac M1 (Big Sur, Monterey) for Rcpp and other tools

I'm trying to use packages that require Rcpp in R on my M1 Mac, which I was never able to get up and running after purchasing this computer. I updated it to Mon

R - subscript out of bounds with stringer and grep in lapply function

My goal is to extract strings of digits with fixed length (8 digits) from multiple text files in several folders after matching a certain pattern. I have spent

How to combine 2 RTF files in R

I'm unable to combine 2 or more RTF files in R. Anybody who knows please help me out. I'm trying to add footnotes for the rtf files but they are not taking it.

Ways to select multiple columns in base R using the native pipe |>?

What are good ways to select multiple columns of a data frame in base R using the native pipe |>? (i.e., without the tidyverse/dplyr to reduce external depen

DADA2 - Calculating percent of reads that merged

I have been following the tutorial for DADA2 in R for a 16S data-set, and everything runs smoothly; however, I do have a question on how to calculate the total

How can I write this to include multiple conditions?

I am trying to write out excel files as workbooks where columns satisfy more than one condition. I receive errors here with grep function and unexpected } If I

Should R package functions not include comments?

I'm in the process of creating a small R package containing a set of functions that should be useful in a specialized area of Biology. I currently have the pack

Using read_excel to upload and automatically name all existing workbook sheets (without specifying the number of sheets)

I would like to adapt the answer below, taken from this question. # Example data write.xlsx(mtcars, "mt cars.xlsx") write.xlsx(mtcars, "mt car s.xlsx") temp =

Change order value [duplicate]

I have a DB like this: a <-c(4, 2, 10, 2, 10, 6, 2) b <-c(4, 6, 70, 8, 18, 4, 3) rbind(a,b) I can create something like this: x <- (

how to create 100 vectors in R in one go, and combine them all into one dataset

I have a list in my workspace named “sample_experiment”, from which I need to draw some information in the form of vectors, like this: first_column

going from SVM model to MaxEnt

I want to use Maxent instead of the SVM model, so can anyone help? This was posted on August 1, 2010. # le modèle est calculé avec les valeurs par

Predict out of sample on fixed effects model

Let's consider model : library(plm) data("Produc", package = "plm") model <- plm(pcap ~ hwy + water, data = Produc, model = 'within') To calculate fitted v

coeftest() gives error with drc class object

I am trying to reproduce a supplementary example 2 Continuous response: one dose-response curve from the drc package. When trying to run coeftest(ryegrass.LL.4

How to insert rows in specific indices of dataframe containing sum of few rows above only in R pipe dplyr

for dataframe below, df <- data.frame(id = c(rep(101, 4), rep(202, 3)), status = c("a","b","c","d", "a", "b", "c"), wt = c(10

Sources for Geospatial environmental / terrain / topographic classification

EDIT: (11/05/22) Coastal classifications would serve a purpose at this stage if there exists such classifications based on NE co-ordinates. If anyone might be

How to recursively create squares, based on previous squares?

I have a df that contains coordinates to create a square: library(ggplot2) df = data.frame(xmin = 1, xmax = 3, ymin = 10, ymax = 15) ggplot(df) + geom

Can't suppress error message in R Markdown?

I'm making a tutorial using RMarkdown and I can't suppress the error message I'm getting. The reason I'm suppressing the error is because the code I'm running

How do you identify column numbers based on partial string match in a way that can be used with lapply?

I have a df with about 1200 columns and the colnames are related to the response categories (ie. Likert scale identifiers). It is similar in format to the df cr