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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:19:44+00:00 2026-05-28T20:19:44+00:00

i am now having a single date vector A (362 rows) and i have

  • 0

i am now having a single date vector A (362 rows) and i have a 3D matrix B (dimensions 360*180*3620)

> str(ssta_date)
 POSIXlt[1:362], format: "1981-11-15" "1981-12-15" "1982-01-15" "1982-02-15" "1982-03-15" ...

> dim(ssta_sst)
[1] 360 180 362

is it possible to combine A and B as a data frame or something else. it must match each date and each temperature in the B [,,362]. so each date will corresponding to a 360*180 matrix.

Because i am planning to do this t to select certain month data, is there any shortcut to do month data selection without combine the two data sets?

  • 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-28T20:19:45+00:00Added an answer on May 28, 2026 at 8:19 pm

    If I understand what you want,
    you can use melt to convert your array to a data.frame,
    and then use merge to join it with the other piece of data.
    If you want an array at the end, you can use acast
    to convert the data.frame back to an array.

    # Sample data
    n <- 10
    d <- array( 
      rnorm(n^3),
      dim = c(n,n,n), 
      dimnames = list(
        One   = LETTERS[1:n], 
        Two   = LETTERS[1:n], 
        Three = LETTERS[1:n]
      ) 
    )
    x <- data.frame( One=LETTERS[1:n], x=runif(n) )
    
    library(reshape2)
    d <- melt(d)
    d <- merge( d, x, by="One", all=TRUE )
    d$result <- d$value + d$x # Do something with the data
    acast( d, One ~ Two ~ Three, value.var="result" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have simple form with a single input. I'm trying to use
I see lot of new machines and laptops now having 64 bit hardware and
The idea I'm playing with right now is having a multi-leveled tier system of
I've been going at this problem for a solid couple hours now and having
Having been spoiled by ruby for so long, I now find myself having to
I've already looked around but couldn't find the exact solution/problem I'm having right now.
Currently having some problems- now = datetime.datetime.now() month = now.strftime(%B) site = wikipedia.getSite('en', 'wikiquote')
Having worked with Classic ASP for about 2 years now by creating a few
We are having this problem with a controller right now; the controller looks like
Having been an imperative developer for some years now, I had never had the

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.