0

i'm a newbie to R and now I'm having trouble converting my numerical data into factors.

I read my cvs file into R with two types of variables (Time and result)

I am looking to see if time (numerical) has an impact on result (already 1 or 0).

I am trying to set time into three categories, >=12hr, 6hr<=time<12hr, and 0<=time<6hr.

How do i do it?

I tried some solutions online by some are converting the data into data frame. wondering if we are able to work with the tibble.

Elvis
  • 1
  • I've linked to our FAQ about creating bins from numeric data. Generally you shouldn't worry if your data is a data.frame or a tibble, you can freely convert back and forth with `as.data.frame()` or `as_tibble()`, but it will rarely make a difference - almost every function that needs a tibble will accept a data frame and convert for you. – Gregor Thomas Apr 06 '23 at 14:52
  • 1
    If you need more help than the FAQ provides, please make your question reproducible. (a) provide sample input in a nice copy/pasteable format (such as `dput(your_data[1:10, ])` for the first 10 rows), (b) show your desired output for that sample input, and (c) show what you've tried so we can see where your misunderstanding are and help to correct them. – Gregor Thomas Apr 06 '23 at 14:53

0 Answers0