Resources
Answers
Examples
Sign in
Get Started
What do you want to save?
Add Code snippet
New code examples in category R
Ajay Vyas
2021-09-12 14:51:01
geom_abline vertical line
p + geom_vline(xintercept = 5)
Add solution
EdwardL
2021-09-12 12:34:03
rmarkdown section title as variable ##
```{r, results="asis", echo = FALSE} i = 1 cat("## Subject", i, "\n") plot(i) i = 2 cat("\n\n## Subject", i, "\n") plot(i) ```
Add solution
Thameem
2021-09-11 18:56:02
r - remove NA from a coulm
df <- data.frame(x = c(1, 2, 3), y = c(0, 10, NA), z=c(NA, 33, 22)) subset(df, !is.na(y))
Add solution
Anselmolsm
2021-09-11 02:41:02
r convert vector to string
# Basic syntax: toString(your_vector) # Example usage: your_vector = c(1,2,3,4,5) toString(your_vector) --> "1,2,3,4,5"
Add solution
John Smart
2021-09-11 01:40:04
how to get quantile summary statistics in r summarise
five_number_summary <- iris %>% group_by(Species) %>% summarise_at(vars(Sepal.Length), list(min=min, Q1=~quantile(., probs = 0.25), median=median, Q3=~quantile(., probs = 0.75), max=max...
Add solution
Erik Larsson
2021-09-10 18:06:04
layar names in R worldclim
values <- extract(r,points) df <- cbind.data.frame(coordinates(points),values)
Add solution
George White
2021-09-10 14:42:03
how to get the number of individual numbers in a vector in r
> as.data.frame(table(numbers)) numbers Freq 1 4 2 2 5 1 3 23 2 4 34 2
Add solution
Jme
2021-09-10 05:58:02
convert dataframe row to vector r
# if you wish to keep the names: unlist(df[1,]) a b c 1.0 2.0 2.6 is.vector(unlist(df[1,])) [1] TRUE
Add solution
Jerome Viveiros
2021-09-10 02:22:01
R regress one variable on all the other variables
mod <- lm(y ~ . - x3, data = d)
Add solution
Dutch
2021-09-09 23:50:05
area under the curve in r
library(zoo) x <- 1:10 y <- 3*x+25 id <- order(x) AUC <- sum(diff(x[id])*rollmean(y[id],2))
Add solution
‹
1
2
...
18
19
20
21
22
23
24
25
26
27
›
Best helpers
daily
weekly
monthly
for 3 months
Tushar
+5
Aralee
+5
Emma Rose Schwichtenberg
+5
Tzetachi
+5
Donald Ellis
+5
Jiang Joanna
+5
Dmytro Leonenko
+5
Forky
+5
AMR
+5
Tatenda
+5
Juan P
+5
Rondoh
+5
show more
This website uses cookies to make IQCode work for you. By using this site, you agree to our
cookie policy
Welcome Back!
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign in
E-mail
Password
Recover lost password
Log in
Or log in with
Not registered?
Sign up takes less than a minute
Create a Free Account
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign up
Email
Password
Sign up for free
Or sign up with
By signing up, you agree to the
Terms and Conditions
and
Privacy Policy
. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.