Re: [R] Read all the 332 files and count the number of complete rows

2016-01-27 Thread David Winsemius
The number 332 suggests that this is homework from Peng's online class. Isn't there there a website for questions regarding these exercises? I have observed a fair number of similar question on StackOverflow over the years so you might also search there, since your error is a fairly common one.

Re: [R] Read all the 332 files and count the number of complete rows

2016-01-27 Thread PIKAL Petr
Hi Just to clarify. Both id and and ncases are numbers. You say you want a vector. In that case just plain idcase<-c(idcase,ncases) shall give you desired vector, provided you initialize idcase before cycle by idcase <- NA The code itself is suboptimal but if you have only couple of files it

[R] Read all the 332 files and count the number of complete rows

2016-01-27 Thread Baba s
Hi, I want this function to read all the 332 files and count the number of complete rows in the data. When I run this function, I am getting only the last one. It should give me id and rowcount for 332 files in one vector. What am I doing wrong in this code? complete<-function(id=1:332){ all_

[R] Any packages similar to XMLmapper interface of SAS in R??

2016-01-27 Thread sowmiyan
Can anybody provide me with some pointers to some package or code snippets similar to that of XMLmapper interface of SAS. XMLmapper reads a xml file and derives by it own "Parent Child relation" "Child Grandchildren relation" and so on and provide separate csv files for each hierarchy drill down.

[R] randomForest and factor predictors--unexpected results

2016-01-27 Thread Richard L. Valliant
I'm been experimenting with the randomForest R package (v. 4.6-12) and getting an unexpected difference between rpart and randomForest results that may have something to do with using x's that are factors. The same model (see code below) is used to predict a 2-value variable called "resp" tha

[R] R-help with markovchain package and sensitivity analysis

2016-01-27 Thread Kristin Bornstein
Hi - I'm currently trying to work with a markov chain transition matrix developed using the markovchain package (it's a 42x42 matrix model). I've got the matrix up and running smoothly with no problems. However, I'm trying to run some sensitivity analyses and distribution analyses on the model, an

Re: [R] Error : there is no .Internal function 'par'

2016-01-27 Thread Jim Lemon
Hi Kim, The only thing that I can think of is that some packages that were previously loaded automatically may now have to be loaded explicitly. Have you tried adding: require(graphics) to your code? Jim On Wed, Jan 27, 2016 at 8:56 PM, Kim Pilegaard wrote: > I have a function that calls par

Re: [R] Error : there is no .Internal function 'par'

2016-01-27 Thread Duncan Murdoch
On 27/01/2016 4:56 AM, Kim Pilegaard wrote: I have a function that calls par, it has worked nicely before. Now I get the following error: Error in par(mar = c(5.1, 4.1, 5.1, 2.1)) : there is no .Internal function 'par' Can anyone give me a hint so solve this problem? You have a copy of pa

Re: [R] Error : there is no .Internal function 'par'

2016-01-27 Thread William Dunlap via R-help
Did you somehow get a copy of the Splus par function into your R workspace? Use the conflicts() function to see if you have something masking par. Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Jan 27, 2016 at 1:56 AM, Kim Pilegaard wrote: > I have a function that calls par, it has work

Re: [R] Error : there is no .Internal function 'par'

2016-01-27 Thread Uwe Ligges
On 27.01.2016 10:56, Kim Pilegaard wrote: I have a function that calls par, it has worked nicely before. Now I get the following error: Error in par(mar = c(5.1, 4.1, 5.1, 2.1)) : there is no .Internal function 'par' Can anyone give me a hint so solve this problem? Your R is broken...

[R] Error : there is no .Internal function 'par'

2016-01-27 Thread Kim Pilegaard
I have a function that calls par, it has worked nicely before. Now I get the following error: Error in par(mar = c(5.1, 4.1, 5.1, 2.1)) : there is no .Internal function 'par' Can anyone give me a hint so solve this problem? Kim Kim Pilegaard Professor Atmospheric Environment DTU Environment

[R] rpart and survey weights

2016-01-27 Thread Erofili Grapsa
Dear R users I have a question regarding rpart and survey weights. In the introduction to rpart document it says "Weights are not yet supported, and will be ignored if present", however they are somehow used as the results are different with and without weights. Can weights now be used and if yes,

Re: [R] normalmixEM gives widely divergent results.

2016-01-27 Thread Ranjan Maitra
On Wed, 27 Jan 2016 11:51:07 -0500 John Sorkin wrote: > I am running normalmixEM: > mixmdlscaled <- normalmixEM(data$FCWg) > summary(mixmdlscaled) > plot(mixmdlscaled,which=2) > > If I run the program multiple times, I get widely different results: > > > mixmdlscaled <- normalmixEM(data$FCW

Re: [R] normalmixEM gives widely divergent results.

2016-01-27 Thread William Dunlap via R-help
You could start by sorting the components, by lambda (size) or by mu (mean) since, if you don't supply starting values, the order of the components is random. You could use the following to sort normalmixEM's output: sort.mixEM <- function (x, decreasing = FALSE, ..., by = "lambda") { stopifn

[R] normalmixEM gives widely divergent results.

2016-01-27 Thread John Sorkin
I am running normalmixEM: mixmdlscaled <- normalmixEM(data$FCWg) summary(mixmdlscaled) plot(mixmdlscaled,which=2) If I run the program multiple times, I get widely different results: > mixmdlscaled <- normalmixEM(data$FCWg) number of iterations= 41 > summary(mixmdlscaled) summary of normalmixE