Re: [R] How is a file descriptor stored ?

2013-08-07 Thread mohan . radhakrishnan
Hi, The file handling code sometimes throws this exception. Error in UseMethod("close") : no applicable method for 'close' applied to an object of class "c ('integer', 'numeric')" Is there a sample based on my code that I can test ? I want to extract the file descriptors from the hashmap and

Re: [R] Extracting only multiple occurrences

2013-08-07 Thread David Winsemius
On Aug 7, 2013, at 11:23 PM, Kevin Parent wrote: > Well that almost works, and I didn't know about duplicated() so thanks for > that. However, it only gives me the duplicated values. I need the original > ones too. So the result I want is: [g,g,m,m,s,s,t,t,u,u,u,v,v,x,x,y,y,y]. > What duplicat

Re: [R] Extracting only multiple occurrences

2013-08-07 Thread Kevin Parent
Well that almost works, and I didn't know about duplicated() so thanks for that. However, it only gives me the duplicated values. I need the original ones too. So the result I want is: [g,g,m,m,s,s,t,t,u,u,u,v,v,x,x,y,y,y]. What duplicated() gives me is [g,m,s,t,u,u,v,x,y,y]   Playing around wi

Re: [R] Extracting only multiple occurrences

2013-08-07 Thread David Winsemius
On Aug 7, 2013, at 11:03 PM, David Winsemius wrote: > > On Aug 7, 2013, at 10:37 PM, Kevin Parent wrote: > >> Hoping someone here can help me with this small problem. >> set.seed(2013) >> >> x<-sort(c(letters,letters[sample(26,10,1)])) >> >> This gives a vector of 36 letters with some muliple

Re: [R] Extracting only multiple occurrences

2013-08-07 Thread David Winsemius
On Aug 7, 2013, at 10:37 PM, Kevin Parent wrote: > Hoping someone here can help me with this small problem. > set.seed(2013) > > x<-sort(c(letters,letters[sample(26,10,1)])) > > This gives a vector of 36 letters with some muliples (in this case, > g,m,s,t,u,v,x,y). Now what I need is to get ri

[R] Extracting only multiple occurrences

2013-08-07 Thread Kevin Parent
Hoping someone here can help me with this small problem. set.seed(2013) x<-sort(c(letters,letters[sample(26,10,1)])) This gives a vector of 36 letters with some muliples (in this case, g,m,s,t,u,v,x,y). Now what I need is to get rid of the ones that only occur once and keep the multiples. I nee

[R] Running time complexity of Seasonal ARIMA model (forecast package)

2013-08-07 Thread Mohit Dhingra
*Dear All,* I am using Seasonal ARIMA model for predicting cloud workloads. I want to know the running time complexity of building model by the algorithm implemented in R (I am not sure, is it Yule-Walker?). I want to know if it is polynomial O(n^2) etc. or exponential or linear (O(n)). Can someo

Re: [R] CFA and Factor scores from ordered Likert scale items using SEM and Lavaan packages

2013-08-07 Thread John Fox
Dear J?nis, On Wed, 7 Aug 2013 12:36:11 +0300 J?nis Mucenieks wrote: > Hello! > I'm trying to do some confirmatory factor analysis with for ordered Likert > scale items using sem and lavaan packages. So far I have read a lot and > searched a lot but working example has so far eluded me. Can some

Re: [R] bbmle: mle2: initial value in 'vmmin' is not finite

2013-08-07 Thread Ben Bolker
Thomas Cameron emg.umu.se> writes: > Dear R users > I am trying to estimate parameter values for function > using optim in the mle2 function in the bbmle package but I cannot > get past the above error message. [snip] > # load packages > library(bbmle) > library(emdbook) > > # specify th

Re: [R] descriptive stats by cells in factorial design

2013-08-07 Thread Mike Miller
On Tue, 6 Aug 2013, David Winsemius wrote: Look at the code. You are attributing behavior to `summaryBy` that should be ascribed to `print.data.frame`, and to `format.data.frame`. Your function is returning a numeric vector and getting displayed by `print.default`. Thanks! That's the thing

Re: [R] How to auto adjust panel width according to number of box plots in bwplot

2013-08-07 Thread Aziz, Muhammad Fayez
Thank you so much Richard. Your solution worked like a charm. I worked out my weight vector w for each type of my plots and the results were smooth as butter. Sure I shall be succinct in display of code and data inside correspondence to r-help in future. Dennis gave me a few tips on how to d

[R] bbmle: mle2: initial value in 'vmmin' is not finite

2013-08-07 Thread Thomas Cameron
Dear R users I am trying to estimate parameter values for function using optim in the mle2 function in the bbmle package but I cannot get past the above error message. I am trying all the recommendations in the optim manual and the answers to this question so far in the archive so I assume I ha

Re: [R] p values for partial correlations

2013-08-07 Thread Tal Galili
A short self contained code would help us help you. You can try using "str" on the output of the command you are using, and try to understand where the p.value is located. Tal Contact Details:--- Contact me: tal.gal...@gmail.

Re: [R] MDA

2013-08-07 Thread Tal Galili
Hi Tjun, It sounds like you need to go on an NA hunt (e.g: find your missing values in the data). Maybe try running this code: ss <- which(apply(is.na(forsen[,-f]), 1, sum)>0) forsen[ss,-f] And try to see if you can find these rows. You can also use the above data to find which rows to remove a

[R] stepAIC with logistf function

2013-08-07 Thread Dustin Fife
Hi, I'm doing research with biodata where I'm trying to predict disease state from many biomarkers. Unfortunately it's not a common disease, so the sample size is small. When I run the model as a glm, it has separation issues. Consequently, I ran the model using logistf with no problems. Now, how

[R] p values for partial correlations

2013-08-07 Thread Demetrio Luis Guadagnin
Dear: I needed to calculate partial correlations and used the package corpcor for that purpose. The output doesnot provide p values and I was unable to find information or posts on how to get them. Does someone can help me? Thanks. -- Dr. Demetrio Luis Guadagnin Conservação e Manejo de Vida Silve

Re: [R] lmer( ) parameter estimates changing depending on dummy-coded reference level

2013-08-07 Thread Alan Mishler
Thank you, I'll post there. Regards, Alan On Wed, Aug 7, 2013 at 1:14 PM, Bert Gunter wrote: > I think it's fair to say that this should really be posted on the > mixed-model specific (especially using lme4) list r-sig-mixed-models > and not here. > > Cheers, > Bert > > On Wed, Aug 7, 2013 at

[R] IRanges::unlist in package

2013-08-07 Thread Blanchette, Marco
Dear all, I am writing a package with some of my favorite custom functions so that I can share them with others. I do not have a lot of experience building these packages and I apologize if this is a trivial question. The issue I am having is with the generic function unlist used to unlist GRa

Re: [R] need held to build a loop for reading multiple datasets

2013-08-07 Thread Rui Barradas
Hello, Also note that the index to datalist should be i + 1, 0 is not an allowed index number. datalist[[i + 1]] <- read.table(...) Hope this helps, Rui Barradas Em 07-08-2013 20:10, David Winsemius escreveu: On Aug 7, 2013, at 11:31 AM, Philipp Rath wrote: Hello r-community, my name

Re: [R] read.table.ffdf and fixed width files

2013-08-07 Thread Jan van der Laan
What probably is the problem is that read.table.ffdf uses the nrows argument to read the file in chunks. However, read.fwf doesn't use a nrow argument but a n argument. One (non tested) solution is to write a wrapper around read.fwf and pass this wrapper to read.table.ffwf. Something like:

Re: [R] need held to build a loop for reading multiple datasets

2013-08-07 Thread David Winsemius
On Aug 7, 2013, at 11:31 AM, Philipp Rath wrote: > Hello r-community, > > my name is philipp and i´m studying economics at the university of bonn. > I´m writing a paper about an experimental entry game and need help to write a > for loop. > > for (i in 0:7) { > > data <- read.table("~/Uni/SoS

Re: [R] laf_open_fwf

2013-08-07 Thread Jan van der Laan
Dear Christian, Well... it shouldn't normally do that. The only way I can currently think of that might cause this problem is that the file has \r\n\r\n, which would mean that every line is followed by an empty line. Another cause might be (although I would not really expect the results you

[R] need held to build a loop for reading multiple datasets

2013-08-07 Thread Philipp Rath
Hello r-community, my name is philipp and i´m studying economics at the university of bonn. I´m writing a paper about an experimental entry game and need help to write a for loop. for (i in 0:7) { data <- read.table("~/Uni/SoSe 13/Bachelorarbeit/entryGameAnalysis/analysis/data/23.04.13...10H/G

Re: [R] MOB (party package) Question - Variable Selection

2013-08-07 Thread Achim Zeileis
Michael: Hi. I am a grad student and I'm currently using the MOB function in the R party package and I had a question. I am working on an environmental problem with about 100 predictors. I am having trouble determining which predictors to use for regression and which for partitioning, is there

Re: [R] lmer( ) parameter estimates changing depending on dummy-coded reference level

2013-08-07 Thread Bert Gunter
I think it's fair to say that this should really be posted on the mixed-model specific (especially using lme4) list r-sig-mixed-models and not here. Cheers, Bert On Wed, Aug 7, 2013 at 9:01 AM, Alan Mishler wrote: > Hi everyone, > > I'm writing with a question about lmer( ) in the lme4 package.

[R] MOB (party package) Question - Variable Selection

2013-08-07 Thread mijohnso
Hi. I am a grad student and I'm currently using the MOB function in the R party package and I had a question. I am working on an environmental problem with about 100 predictors. I am having trouble determining which predictors to use for regression and which for partitioning, is there any sort o

[R] lmer( ) parameter estimates changing depending on dummy-coded reference level

2013-08-07 Thread Alan Mishler
Hi everyone, I'm writing with a question about lmer( ) in the lme4 package. I've searched around for answers and done quite a bit of experimentation with toy data sets to figure out my issue, and I haven't been able to resolve it. I'm running linear mixed effects models on a large, sparse dataset

Re: [R] odfWeave post processing error

2013-08-07 Thread John Kane
I think we would need to see the odt file. You might want to upload it to some place like www.mediafire.com or www.dropbox.com so that R-help readers can take a look at it. John Kane Kingston ON Canada > -Original Message- > From: cougar...@hotmail.com > Sent: Tue, 6 Aug 2013 14:20

[R] Help with unzip error -1

2013-08-07 Thread Marco Pomati
I'm running Rx64 3.01 on Windows 7 and until the other day I could easily unzip zip files with unzip (package utils 3.01). Since yesterday however I get an error. Let's say my zipfile file path is called zfile (I'm omitting the output directory for this example). When I try to unzip it I get the fo

[R] CFA and Factor scores from ordered Likert scale items using SEM and Lavaan packages

2013-08-07 Thread Jānis Mucenieks
Hello! I'm trying to do some confirmatory factor analysis with for ordered Likert scale items using sem and lavaan packages. So far I have read a lot and searched a lot but working example has so far eluded me. Can someone please take a look at the data and tell me if what I'm doing is correct (lav

Re: [R] How is a file descriptor stored ?

2013-08-07 Thread Jan van der Laan
I don't know how many files you are planning to open, but what you also might run into is the maximum number of connections namely 125. See ?file. Jan mohan.radhakrish...@polarisft.com schreef: Hi, I thought that 'R' like java will allow me to store file names (keys) and file d

Re: [R] How is a file descriptor stored ?

2013-08-07 Thread William Dunlap
> Use > > assign(key, file( key, "w" ), envir=cpufile) > > In your assign expression you are assigning cpufile to the third formal > argument which is > pos. > You meant the envir argument, I presume. Or use the syntax cpufile[[key]] <- file(key, "w") instead of assign(key, file( key, "

Re: [R] problem with mahal function Package dismo

2013-08-07 Thread Jon Olav Skoien
Hi Ernesto, I think the issue is that the mahal function treats the arguments differently depending on the class. If you pass the arguments x and p as raster and data.frame/matrix, it will use the values of x at the locations defined in p as training data. If you pass a data.frame, it will assu

Re: [R] Stuck in size when looping

2013-08-07 Thread Adams, Jean
Rolf, It's great that you provided example data and code. It's helpful if you provide data in a way that's easy for others to run. For example, you can use the output from the call to the dput() function. dput(dtot) dput(newtot) Then you could share the example data like this: # TRAINING data..

Re: [R] help f0r R

2013-08-07 Thread Rui Barradas
Hello, Please send questions to R-Help, r-help@r-project.org. As for your question, how have you imported the file, what command have you used? Rui Barradas Em 07-08-2013 11:59, waqas shafqat escreveu: plz sir i have tried diallel analysis in r. i import the file and when entered command,

Re: [R] How is a file descriptor stored ?

2013-08-07 Thread Berend Hasselman
On 07-08-2013, at 12:13, mohan.radhakrish...@polarisft.com wrote: > > Hi, >I thought that 'R' like java will allow me to store file names > (keys) and file descriptors(values) in a hashmap. > > > filelist.array <- function(n){ > sink("nmon.log") > cpufile <- new.env(hash=T, parent=em

Re: [R] Structural equation models (SEM) for count data / poisson distribution

2013-08-07 Thread John Fox
Dear Stella, The sem package doesn't make provision for count data. Because the sem() function allows the user to specify an arbitrary objective function, if you know the likelihood for the model that you want to fit, you could in principle write a corresponding objective function, but this wou

Re: [R] R Job taking longer in Linux than in Windows

2013-08-07 Thread Patrick Connolly
On Fri, 02-Aug-2013 at 01:14PM -0700, alina andrei wrote: |> Hello, |> ? |> I am running an R job on a Windows 7 machine, having 4 cores and |> 16GB RAM?, R 3.0.1,?and it takes 1.5 hours to complete. I am |> running the same job in R on a Linux enviroment (Platform: |> x86_64-redhat-linux-gnu (6

[R] How is a file descriptor stored ?

2013-08-07 Thread mohan . radhakrishnan
Hi, I thought that 'R' like java will allow me to store file names (keys) and file descriptors(values) in a hashmap. filelist.array <- function(n){ sink("nmon.log") cpufile <- new.env(hash=T, parent=emptyenv()) for (i in 1:n) { key <- paste("output", i, ".txt", sep = "") as

[R] Stuck in size when looping

2013-08-07 Thread Rolf Edberg
Hi I have a problem with getting stuck in the number of rows that the first data group has when looping. Let me explain the program: I want to run randomForest on 200 stocks and get scores of each of them. First I shall point at the training data set file(with data from 200 stocks) then I