Category "r"

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

How do I plot multiple caterpillar plots in one graph in ggplot?

So I have successfully plotted these graphs individually, now I want to create a plot that has all three categories in one graph with same scales but different

How to detect the number of grouped data based on their frequency

I have a vector of numbers x <- c(1,1,1,3,3,3,2,2,1,2,1,2,55,56,55,54,55,54,53,55,56,55,7,7,9,9,8,8,11,110,111,11,112,113,111,112,33) if I plot x, hist(x)

Computation failed in `stat_contour_fill()`

I'm trying to generate the contour map of LAI in the forest. I used geom_contour_fill function from the metR package. My data looks like this LAI latitude long

PCA - All variables with same signal on PC1 coordinates

So, I am analyzing a dataset that consists of 160 observations and 20 variables and am performing a PCA. It is about patients affected by a disease and the vari

Communication between modules and looping through values to create several modules

Goal I have five expectations: Solution using modules Communication between modules Dynamic creation of modules local storage using shinyStore Export result in

Internal link between tabs to specific section in R Shiny app

I want to link to a specific content of another tabPanel within an R Shiny app. I've found plenty of advice on how to do the half part of it respectively: there

Perform row-wise operation in datatable with multiple elements

I have the following data table: library(data.table) set.seed(1) DT <- data.table(ind=1:100,x=sample(100),y=sample(100),group=c(rep("A",50),rep("B",50))) No

Problems with excessive white space in Quarto document

I have a Quarto (RMarkdown) document which is supposed to display a table showing task completion. The code works well but there is excessive white space displa

Rowbinding all combinations of two vectors for each variation in a third vector

I have data as follows: cat <- structure(c("east", "north", "south", "west"), .Dim = c(1L, 4L ), .Dimnames = list("categories", NULL)) down <- structure(c

How can I draw a similar graph with ggplot2 to find the difference between two works?

I am reading the book Text Mining with R: A Tidy Approach by Julia Silge & David Robinson to try to find the difference between two works, and not the three

Add additional labels from a DataFrame to a facet_grid with existing label

I have a set data that I need to add to levels of labels. One on a single chart within the facet grid, and one from a small dataframe with entries for for each