Re: [R] with vs. attach

2016-05-08 Thread Bert Gunter
... To be clear, Hadley or anyone else should also feel free to set me straight, preferably publicly, but privately if you prefer. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "B

Re: [R] Problem while predicting in regression trees

2016-05-08 Thread Bert Gunter
It seems that the data that you used for prediction contained a level "Hospitals" for the sector factor that did not appear in the training data (or maybe it's the other way round). Check this. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and s

Re: [R] with vs. attach

2016-05-08 Thread Bert Gunter
Jeff: That's easy to do already with substitute(), since you can pass around an unevaluated expression (a parse tree) however you like. As I read it, (admittedly quickly) what it's main feature is that it allows you more control over the environment in which the expression is finally evaluated --

[R] Problem while predicting in regression trees

2016-05-08 Thread Muhammad Bilal
Hi All, I have the following script, that raises error at the last command. I am new to R and require some clarification on what is going wrong. #Creating the training and testing data sets splitFlag <- sample.split(pfi_v3, SplitRatio = 0.7) trainPFI <- subset(pfi_v3, splitFlag==TRUE) testPFI <-

Re: [R] with vs. attach

2016-05-08 Thread Jeff Newmiller
The lazyeval package addresses the problem of how to delay evaluation even when the function you want to do the evaluation in is buried two or more function calls below where the original call was made. If you are not building nested function calls with delayed evaluation then you probably don't

Re: [R] with vs. attach

2016-05-08 Thread Spencer Graves
Hi, Hadley et al.: Hadley's link requires his development version of "lazyeval", which can be obtained as follows: library(devtools) install_github("hadley/lazyeval") Hadley's link describes real problems with elegant solutions. However, David's solution solved my immed

Re: [R] Pl help with code and graph

2016-05-08 Thread Jim Lemon
Hi Prasad, You are probably looking for linear modelling of some sort. The first thing to do is to read the data into R (if you haven't already done so). You will almost invariably have a _data frame_ in which the columns will contain values for at least year and profit. Then plot the profits of A

Re: [R] trainControl and train functions are not found in caret package

2016-05-08 Thread Muhammad Bilal
Thanks you very much. The issue resolved by just upgrading the R and R studio to their latest versions. All the packages are now successfully installed. Henceforth, the code runs absolutely okay. -- Muhammad Bilal Research Fellow and Doctoral Researcher, Bristol Enterprise, Research, and Inno

Re: [R] Pl help with code and graph

2016-05-08 Thread Bert Gunter
This is not a code writing service. Posters are expected to first make an honest effort and show us their code as part of their post. Please read the posting guide to learn more. Most attachments, including Excel files, are stripped by the mail server. Use ?dput to include example data in a post.

[R] Pl help with code and graph

2016-05-08 Thread Prasad Kale
Hi, I am very new to R-studio data modelling so can anyone help me with a detail code which provides a graph which will provides information in which year my company i.e. A will reaches 1 lacs crs. milestone and by that time where my competitors i.e. B and C will stands. I am attaching a excel in

Re: [R] trainControl and train functions are not found in caret package

2016-05-08 Thread ruipbarradas
Hello, Works with me, but I'm using R v 3.3.0. Note that your version of R is over 1 year old, try updating it. install.packages("caret") install.packages("e1071") library(caret) library(e1071) set.seed(100) tr.control <- trainControl(method="cv", number=10) class(tr.control) [1] "list" Ho

Re: [R] trainControl and train functions are not found in caret package

2016-05-08 Thread Muhammad Bilal
Firstly, many thanks for kind consideration. ***I wrote the following R code: install.packages("caret") install.packages("e1071") library(caret) library(e1071) set.seed(100) tr.control <- trainControl(method="cv", number=10) Error: could not find function "trainControl" cp.grid <- expand.grid(