Category "r"

How to output bootstrap results to LaTeX in R

library(boot) boot_function <- function(data, indices, formula){ d <- data[indices, ] obj <- lm(formula, d) coefs <- summary(obj)$coefficient

Using "raw" source data in MixSIAR package and also grouping by random factor

I'm using the MixSIAR package in R to estimation proportional water source use (groundwater versus soil moisture) by different tree species based on stable oxyg

How to do a simulation of a hypothesis test (using the Wald test) and report the Monte Carlo standard error of the power?

I am reading https://cran.r-project.org/web/packages/rsimsum/vignettes/A-introduction.html and trying to do a simulation of a hypothesis test (using the Wald te

Extracting year from a column that contains dates in m/d/yyyy format

I have a dataset called verts imported from Excel with a column called Date that contains dates in this format: m/d/yyyy. I'm trying to extract the year from th

Optimal Full Matching

I've been learning to do Optimal Full Matching. I was wondering how the treatment column is created. Is there a way to identify which ones are in the treatment

R - Derivatives of the inverse of the regularized incomplete beta function w.r.t. shape parameters [closed]

The regularized incomplete beta function I(x,a,b) is the CDF for a random variable distributed Beta(a,b). I have a problem that requires compu

Error in install.packages : package ‘RGtk2’ not installed because it is not built for UCRT

I tried to install rattle and RGtk2. I used install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/windows/contrib/4.1/RGtk2_2.20.36.2.zip", repos

Problem viewing a pdf file in a shiny app

To view a pdf file and my shiny app, I use the following code on the server side, which everyone recommends: output$pdf_info_exper <- renderUI({ se

Running a MANOVA for habitat selection with missing data in R

I am currently preparing data to conduct a second order and third order habitat selection analysis. For the second-order (use/available), I am looking at the me

R Dataframe Filter Values

I have a dataframe looks like below: Place Time1 Time2 Time3 Time4 Time5 Time6 Time7 Time8 Time9 ... CA 0.2 0.3 0.1 0.

Which version of Java do I need for this

I'm trying to use R and the R package rjdbc to connect to an Oracle database. Unfortunately, due to my company's strict IT department, every step of the proces

getting this error Error: Must request at least one colour from a hue palette

enter image description hereIm trying to stack the above given formula to use on my code, but i keep getting this error Error: Must request at least one colour

Code acting differently inside of a function in R

i've got this set of code here in R that seperates a dataframe containing tweets by their day posted. I'm finding a weird interaction where, if i was to run the

How to make multiple smooth curves in one plot in R (with these data)?

I am a beginner with R. I have the next data: 5 cars drive from A to B, the total distance is 100 km. The speed of these cars is measured during different momen

Extract text after first upper case or space

How can I extract all text after first space in a column where data is something like this structure(list(value = c("1.1.a Blue sea", "1.2.a Red ball")), row.na

How to get week numbers from dates?

Looking for a function in R to convert dates into week numbers (of year) I went for week from package data.table. However, I observed some strange behaviour: &

simR simulate within subjects data from between-subjects design

In my pilot study I applied a between-subjects design. For the follow-up study, a within-subjects manipulation seems more feasable. I want to conduct power anal

Covid-19 Growth rate (Bootstrapping/Time Series)

I am trying to code R in order to obtain growth rate for COVID-19. The equation can be found on the inserted image where i(t) is the number of infected individu

Is there a more efficient way to calculate the difference in months in R

I have a large data frame in a panel structure (201720 rows; 3 columns) which looks as follows: Name <- c("A", "A", "A", "B", "B", "B") Inception <- c(as

How to fix R error: “No consistency on the variables information”

I'm a newbie in r, recently I'm doing a joint modeling of longitudinal and time-to-event data, following the example in the R package "joineR", I only replace t