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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:56:58+00:00 2026-06-04T20:56:58+00:00

I have dataframe dih_y2. These two lines give me a warning: > memb =

  • 0

I have dataframe dih_y2. These two lines give me a warning:

> memb = dih_y2$MemberID[1:10]
> dih_col = which(dih_y2$MemberID == memb)  
Warning message:
In dih_y2$MemberID == memb :
longer object length is not a multiple of shorter object length

Why?

  • 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-04T20:57:01+00:00Added an answer on June 4, 2026 at 8:57 pm

    You don’t give a reproducible example but your warning message tells you exactly what the problem is.

    memb only has a length of 10. I’m guessing the length of dih_y2$MemberID isn’t a multiple of 10. When using ==, R spits out a warning if it isn’t a multiple to let you know that it’s probably not doing what you’re expecting it to do. == does element-wise checking for equality. I suspect what you want to do is find which of the elements of dih_y2$MemberID are also in the vector memb. To do this you would want to use the %in% operator.

    dih_col <- which(dih_y2$MemeberID %in% memb)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dataframe t1 which has two fields names and rollno . I
Say I have a dataframe df with two or more columns, is there an
I have a dataframe of which the columns contain a variable amount of numbers
I have two dataframes and I wish to insert the values of one dataframe
In R I am trying to delete rows within a dataframe (ants) which have
I have dataframe that was created from the fusion of two dataframes. Both spanned
I have a dataframe df. I want to create two subsets (a & b)
I have a dataframe called prices_df to which I add an extra column and
I have a DataFrame, say a volatility surface with index as time and column
I have a DataFrame with a few columns. One columns contains a symbol for

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.