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 8122439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:50:03+00:00 2026-06-06T05:50:03+00:00

I have the following data structure (an atomic vector?) output from daply in plyr

  • 0

I have the following data structure (an “atomic vector?”) output from daply in plyr, in which I had the function return three different measures for each subject, condition, and item.

x = structure(c(-0.93, 0.39, 0.88, 0.63, 0.86, -0.69, 1.02, 0.29, 0.94, 
0.93, -0.01, 0.79, 0.32, 0.14, 0.13, -0.07, -0.63, 0.26, 0.07, 0.87,
-0.36, 1.043, 0.33, -0.12, -0.055, 0.07, 0.67, 0.48, 0.002, 0.008, 
-0.19, -1.39, 0.98, 0.43, -0.02, -0.15,-0.08, 0.74, 0.96, 0.44, -0.005,
1.09, 0.36, 0.04, 0.09, 0.17, 0.68, 0.51, 0.09, 0.12, -0.05, 0.11,
0.99, 0.62, 0.13, 0.06, 0.27, 0.74, 0.96, 0.45), .Dim = c(5L, 
2L, 2L, 3L), .Dimnames = structure(list(Subject = c("s1", "s2", 
"s3", "s4", "s5"), Cond = c("A", "B"), Item = c("1", "2"), c("Measure1", 
"Measure2", "Measure3")), .Names = c("Subject", "Cond", 
"Item", "")))

I want to change it to look like:

Subject Cond Item Measure1 Measure2 Measure3
     s1    A    1    -0.93   -0.360   -0.005
     s1    A    2    -0.01    -0.19    -0.05 
     s1    B    1    -0.69    0.070     0.17
     s1    B    2    -0.07    -0.15     0.06
     s2    A    1     0.39    1.043    1.090
     s2    A    2     0.79    -1.39     0.11
     s2    B    1     1.02    0.670     0.68
     s2    B    2    -0.63    -0.08     0.27

etc.

Is there an easy way to do this?

  • 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-06-06T05:50:05+00:00Added an answer on June 6, 2026 at 5:50 am

    Yes, use adply():

    adply(x, c(1,2,3))
       Subject Cond Item Measure1 Measure2 Measure3
    1       s1    A    1    -0.93   -0.360   -0.005
    2       s2    A    1     0.39    1.043    1.090
    3       s3    A    1     0.88    0.330    0.360
    4       s4    A    1     0.63   -0.120    0.040
    5       s5    A    1     0.86   -0.055    0.090
    6       s1    B    1    -0.69    0.070    0.170
    7       s2    B    1     1.02    0.670    0.680
    8       s3    B    1     0.29    0.480    0.510
    9       s4    B    1     0.94    0.002    0.090
    10      s5    B    1     0.93    0.008    0.120
    11      s1    A    2    -0.01   -0.190   -0.050
    12      s2    A    2     0.79   -1.390    0.110
    13      s3    A    2     0.32    0.980    0.990
    14      s4    A    2     0.14    0.430    0.620
    15      s5    A    2     0.13   -0.020    0.130
    16      s1    B    2    -0.07   -0.150    0.060
    17      s2    B    2    -0.63   -0.080    0.270
    18      s3    B    2     0.26    0.740    0.740
    19      s4    B    2     0.07    0.960    0.960
    20      s5    B    2     0.87    0.440    0.450
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data structure or record, which I need to stream to
I have the following data structure returning from a Yahoo API: cbfunc({ query: {
So I have the following data-structure coming back from my server. {date:'2/1', name: 'product
Continued from this stackoverflow question . I have the following data structure: data =
I have the following data structure (which was actually created by counting the occurences
I have the following data structure: 2011-01-01 00:00, 2011-01-20 00:00, 200 # days-range 2011-01-20
I have something like the following data structure: Category StartDateTime EndDateTime =============================================== 1 12/1/2009
I have an odd linq subquery issue. Given the following data structure: Parents Children
I have the following casting problem when my data structure sSpecificData contains a field
Let's assume I have the following file structure: data.py foo = [] bar =

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.