Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7539719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:27:23+00:00 2026-05-30T07:27:23+00:00

I have a dataframe like this: block plot date data 1 1 aug 11.95171507

  • 0

I have a dataframe like this:

block   plot    date    data
1   1   aug 11.95171507
1   1   aug 18.41451063
1   2   aug 9.506155236
1   2   aug 13.26259947
1   3   aug 17.53616835
1   3   sep 15.40950767
2   1   sep 23.03616678
2   1   sep 17.07067258
2   2   sep 11.58278798
2   2   sep 13.15443304

I would like to calculate the means of data across plot based on block and date. Eventually, i would like to have 5 means.
Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:27:25+00:00Added an answer on May 30, 2026 at 7:27 am

    Probably the path of least resistance is to use plyr:

    library(plyr)
    ddply(yourData, c("block", "date"), summarize, outVal = mean(data))
    

    You can do similar things with data.table, aggregate, by and probably a whole host of other functions. Take a few minutes to peruse the R tag here on SO.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a dataframe like this one: df <- data.frame (id = c(a,
I have a dataframe with numeric entries like this one test <- data.frame(x =
If you have a dataframe like this mydf <- data.frame(firstcol = c(1,2,1), secondcol =
i have a time series data like this: x <- structure(list(date = structure(c(1264572000, 1266202800,
I have a dataframe foo looking like this Date Return 1998-01-01 0.02 1998-01-02 0.04
I have data that looks like this: > head(data) date price volume 1 2011-06-26
I have a dataframe in R like this: dat = data.frame(Sample = c(1,1,2,2,3), Start
I have a dataframe that looks like this: data median min max no_of_threads 2.33
I have a data frame with gaps like this: Var1 Var2 Var3 1 NA
I have a data.frame in R that looks like this: score rms template aln_id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.