Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

ntile function producing only one group

$
0
0

I have a data frame containing numeric variable with no NAs.

I have previously used ntile to split this variable into 10 groups which using in conjuction with mutate gives me a new variable with observations 1-10 depending upon which group is assigned by ntile.

I have tried using ntile function again for the same process but it only gives me one group in my new variable using the code below.

test <- percent_phentoypes_broad.class %>% mutate("basal_percent"=ntile(basal_percent, 10))

I have tried reinstalling dplyr and rstudio but still no luck.

example of percent and ntile output


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>