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

  • Home
  • SEARCH
  • 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 7829499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:48:03+00:00 2026-06-02T10:48:03+00:00

For instance given: dim1 <- c("P","PO","C","T") dim2 <- c("LL","RR","R","Y") dim3 <- c("Jerry1", "Jerry2", "Jerry3")

  • 0

For instance given:

dim1 <- c("P","PO","C","T")
dim2 <- c("LL","RR","R","Y")
dim3 <- c("Jerry1", "Jerry2", "Jerry3")
Q <- array(1:48, c(4, 4, 3), dimnames = list(dim1, dim2, dim3))

I want to reference within this array, the matrix that has the max dim3 value at the (3rd row, 4th column) location.

Upon identifying that matrix, I want to return the column name which has the maximum value within the matrix’s (3rd Row, 1st Column) to (3rd Row, 3rd Column) range.

So what I’d hope to happen is that Jerry3 gets referenced because the number 47 is stored in its 3rd row, 4th column, and then within Jerry3, I would want the maximum number in row 3 to get referenced which would be 43, and ultimately, what I need returned (the only value I need) is then the column name which would be "R".

That’s what I need to know how to do, obtain get that "R" and assign it to a variable, i.e. "column_ref", such that column_ref <- "R".

  • 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-02T10:48:04+00:00Added an answer on June 2, 2026 at 10:48 am

    This should do it – if I understand correctly:

    Q <- array(1:48, c(4,4,3), dimnames=list(
      c("P","PO","C","T"), c("LL","RR","R","Y"), c("Jerry1", "Jerry2", "Jerry3")))
    
    column_ref <- names(which.max(Q[3,1:3, which.max(Q[3,4,])]))[1] # "R"
    

    Some explanation:

    which.max(Q[3,4,]) # return the index of the "Jerry3" slice (3)
    which.max(Q[3,1:3, 3]) # returns the index of the "R" column (3)
    

    …and then names returns the name of the index (“R”).

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

Sidebar

Related Questions

1) If we want to create an instance of a given type during runtime
Given an instance of MyClass, I want to be notified when someone calls an
That's the question xD Given an instance of a CCSprite in cocos2d in iphone,
I have a django application using multiple databases. Given an instance of a model,
Given an XDocument instance, how can I easily get a TextReader that represents that
I need to test, if an instance is exactly of a given type. But
Given I've got an array arr of instances of a custom class My_class .
I want to create a controller that depends on the class of a given
How do I get the installation path for a given instance of SQL Server
Is it possible to check how many references are held to a given instance

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.