Search
 
SCRIPT & CODE EXAMPLE
 

R

how to group rages in r

df <- data.frame(name=c("r", "h", "s", "l", "e", "m"), value=c(35,20,16,40,23,40))
# get categories
df$groups <- cut(df$value, breaks=c(0,21,30,Inf))

# calculate group counts:
table(cut(df$value, breaks=c(0,21,30,Inf)))
Comment

PREVIOUS NEXT
Code Example
R :: how to set a dataframe as a value in a list in r 
R :: how to increment dates inside a for loop in r 
R :: R change column to row names 
R :: st_combine by variables R 
R :: r performance matrix for confusion matrix 
R :: exp() function R 
R :: pairing in r 
R :: how to upload multiple excel files r 
R :: changing base group in factor in r 
R :: sumif in r 
R :: ggplot in R how to show information by hovering 
R :: imputation in r 
Rust :: rust get command line arguments 
Rust :: rust bevy query option 
Rust :: remove file rust 
Rust :: rust how to access elements of an array 
Rust :: read line rust 
Rust :: sum all elements of array rust 
Rust :: how to make map in rust language 
Rust :: rust for loop 
Rust :: stringify! in rust 
Rust :: slice indices are of type usize rust 
Rust :: rust•armanriazi•loop•listen 
Rust :: char is digit rust 
Rust :: armanriazi•rust•error•already borrowed: BorrowMutError 
Lua :: lua dump table 
Lua :: roblox difference between index and newindex 
Lua :: roblox studio lua for loop 
Lua :: how to make a color changing brick in roblox studio 
Lua :: roblox check if in private server 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =