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 |
R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.
0
votes
Extracting data from a data frame with conditions
To accomplish the task, first attach data stored in a df object, then use aggregate function:
attach(df)
aggregate(freq ~ year, FUN=max)
which outputs:
year freq
1 2002 3
2 2003 5
3 2004 …
0
votes
How to group by multiple columns in dataframe using R and do aggregate function
Also is possible to do the task using a very reliable and trusted R base functions:
df <- data.frame(stringsAsFactors=FALSE,
country = c("Austia", "Austia", "Austia", "Austia", "Austia", "Austia …
0
votes
R-GUI How do i aggregate survey data collected for multiple years and see if they contain a ...
For the given example:
df <- data.frame(Study=c('Study_1', 'Study_1', 'Study_2', 'Study_3'), col1=c(NA,NA,5,8), col2=c(8, NA, NA, 7))
apply(df,2, function(x) sum(is.na(x)==F))
shows that number of no …