Category "r"

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

RMarkdown: Error in dir.exists(x) : file name conversion problem -- name too long?

I am working on serial reports with RMarkdown. Since the latest R Update to 4.2.0 I get the error: Error in dir.exists(x) : file name conversion problem -- name

Calculating the difference of all variables to all other variables

Suppose my Dataframe look like: w <- sample(-10:10, size =10) x <- sample(-10:10, size =10) y <- sample(-10:10, size =10) z <- sample(-10:10, size =

Split a fasta file into desired nucelotide length but in a sliding window format

Stuck at a R problem. I have a random fasta file: > header AGTCAGTCAGTC My desired output is: segment1 AGTC segment2 GTCA segment3 TCAG segment4 CA

Count number of rows matching >1 criteria

I have a dataframe with two columns, as follows: A<-c(4,4,4,3,2,4,1) B<-c(4,4,2,31,3,1,1) data<-data.frame(A,B) I know I can use grep() to search for

German keyword search - look for every possible combination

I'm working on a project where I define some nouns like Haus, Boot, Kampf, ... and what to detect every version (singular/plurar) and every combination of these

How to create plot with both vertical and horizontal spikelines in plotly?

Plotly offers the option to display a moveable horizontal or vertical "spikeline" by adding layout(hovermode = "x unified") or layout(hovermode = "y unified") (