Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > df <- data.frame(a=rep(1:3),b=rep(1:3),c=rep(4:6),d=rep(4:6))
- > df
- a b c d
- 1 1 1 4 4
- 2 2 2 5 5
- 3 3 3 6 6
- > df1 <- df[,1:2]
- > df1
- a b
- 1 1 1
- 2 2 2
- 3 3 3
- > df2 <- df[,3:4]
- > df2
- c d
- 1 4 4
- 2 5 5
- 3 6 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement