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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:34:21+00:00 2026-05-26T08:34:21+00:00

Here is an example: height 1 1.5 2 1.3 3 1.9 4 1.5 5

  • 0

Here is an example:

   height
1  1.5
2  1.3 
3  1.9 
4  1.5
5  1.6 

There are 1000 of them with height ranging from 0 to 1.9. And I want to cut them into 3 levels: low, medium and high. Then they are ordinal data.

result should look like this:

   height
1  medium
2  low
3  high
4  medium
5  medium

And the summary should look like:

        height
low:    203
medium: 723
high:   74

I tried to use the loop but then “low, medium and high” are characters, not levels.
Here is how I did the low part:

height_cuts = c(1.5,1.9)
for(i in 1:nrow(health.sample)){
  if(is.na(health.sample$height[i])==FALSE){
    if(health.sample$height[i] < height_cuts[1]){
      health.sample$height[i] = low_h
    }
  }
}
  • 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-26T08:34:21+00:00Added an answer on May 26, 2026 at 8:34 am
    cut(height, quantile(height, prob=c(203, 723, 74)/1000 ), labels=c("low", "medium", "high") )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Example here: [Live example removed - question answered] I'm trying to display this
I'm new here, and very appreciative for all the help I see in this
I don't think this is not another resize iframe according to content height question.
I'm sure a lot of people use the twitter widget that twitter provides. Here's
I'm sure a lot of people use the twitter widget that twitter provides. Here's
Control.Location doesn't take into account the slider position of the parent panel control and
I'm trying to load WebBrowser content and after that I want to add some
ok so im having trouble getting this to work. nothing is happening. view the
I am trying to create a list item layout with 4 items. It is
I have seen a number of interesting posts on the subject of fixed position

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.