i am new to R and rpart. i don't know why can i make tree. here is my code and result
library(rpart)
library(partykit)
onp.tr <- rpart(rshares~., reonp)
onp.tr
> onp.tr
n= 39644
node), split, n, loss, yval, (yprob)
* denotes terminal node
-------------------------------------------
str(reonp)
data.frame': 39644 obs. of 22 variables:
$ rshares : Factor w/ 2 levels "A","B": 1 1 1 1 1 1 1 1 1 1 ...
$ n_tokens_title : int 12 9 9 9 13 10 8 12 11 10 ...
$ n_tokens_content : int 219 255 211 531 1072 370 960 989 97 231 ...
$ n_unique_tokens : num 0.664 0.605 0.575 0.504 0.416 ...
$ num_hrefs : int 4 3 3 9 19 2 21 20 2 4 ...
$ num_self_hrefs : int 2 1 1 0 19 2 20 20 0 1 ...
$ num_imgs : int 1 1 1 1 20 0 20 20 0 1 ...
$ num_videos : int 0 0 0 0 0 0 0 0 0 1 ...
$ average_token_length: num 4.68 4.91 4.39 4.4 4.68 ...
$ num_keywords : int 5 4 6 7 7 9 10 9 7 5 ...
$ kw_min_min : int 0 0 0 0 0 0 0 0 0 0 ...
$ kw_max_min : num 0 0 0 0 0 0 0 0 0 0 ...
$ kw_avg_min : num 0 0 0 0 0 0 0 0 0 0 ...
$ kw_min_max : int 0 0 0 0 0 0 0 0 0 0 ...
$ kw_max_max : int 0 0 0 0 0 0 0 0 0 0 ...
$ kw_avg_max : num 0 0 0 0 0 0 0 0 0 0 ...
$ kw_min_avg : num 0 0 0 0 0 0 0 0 0 0 ...
$ kw_max_avg : num 0 0 0 0 0 0 0 0 0 0 ...
$ kw_avg_avg : num 0 0 0 0 0 0 0 0 0 0 ...
$ is_weekend : int 0 0 0 0 0 0 0 0 0 0 ...
$ channel : Factor w/ 6 levels "Bus","Ent","Life",..: 2 1 1 2 5 5 3 5 5 6 ...
$ weekday : Factor w/ 6 levels "Fri","Mon","THU",..: 2 2 2 2 2 2 2 2 2 2 ...
attributes(reonp)
$names
[1] "rshares" "n_tokens_title" "n_tokens_content" "n_unique_tokens"
[5] "num_hrefs" "num_self_hrefs" "num_imgs" "num_videos"
[9] "average_token_length" "num_keywords" "kw_min_min" "kw_max_min"
[13] "kw_avg_min" "kw_min_max" "kw_max_max" "kw_avg_max"
[17] "kw_min_avg" "kw_max_avg" "kw_avg_avg" "is_weekend"
[21] "channel" "weekday"
$class
[1] "data.frame"