Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Results tagged with r
Search options not deleted
user 30635
R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.
1
vote
Count and summarise ID's each day while creating a new column that shows the accumulated ID's
This is a base solution for your problem:
aggregate(paste(ID , Date) ~ ID + Date, data = df, FUN = length)
there are many more solutions like any of the ones below, using dplyr:
library(dplyr)
df …
1
vote
Accepted
Randomizing selection in R
This will give you a sample with 55 record from the larger data-set that you have.
sample <- df[sample(1:nrow(df), 55, replace=FALSE),]
If you want to make a reproducible example of the sample, yo …
2
votes
acf function shows error while fiiting time series
Logarithm cannot handle numbers less than and equal to zero. You can exclude them from your time-series and then add them to the graph as points with different colors (if they are not many that would …
0
votes
Memory allocating error with coxph model
If you're using a 64-bit version of R on Windows (I'm not sure about other operating systems), then you can allocate additional memory to R with memory.limit function. … You can further read about memory limits in R.
All that said, I would take a step back beforehand to make sure I actually need to deal with all that data and would investigate other alternatives. …
3
votes
Accepted
Adding a trend line or horizontal mean±stdev lines in facet_grid view
What you can do is creating another dataset with the mean and mean±stdev grouped by Tier. Then you can use that in geom_hline and ggplot will pick up facets from Tier. See below;
library(dplyr)
librar …
3
votes
Mirror column plot with different y-axis in ggplot
You can either reshape the data into long format (after joining the two datasets) and use geom_col once, or have two geoms as you have in your question. However, the latter needs some variation to hav …
1
vote
Accepted
Regime detection to identify transitions between habitats
I can tell you that first point of each of the vectors above should be excluded but how we can get R to tell us that, I am not sure at the moment. …