0

i am newbie to R i am using R 3.0.1 version, I have installed rpart package using install.packages("rpart") selected USA(CA 1) in the pop up box and it is installed successfully

> p_data = read.csv(file="/home/sudeep/Desktop/mysql.tsv",sep="\t",dec=".",header=TRUE)
> dtree <- rpart(paid ~ .,data = p_data, method="class")
Error: could not find function "rpart"

so what is wrong with me??

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
Aj here
  • 47
  • 5
  • 15

1 Answers1

9

You don't actually need to install rpart manually; it comes with the base R distribution. However, you do need to load it into your R session with a call to library:

library(rpart)
rpart(paid ~ ., data=....)
Hong Ooi
  • 56,353
  • 13
  • 134
  • 187