Re: [R] lmom package - Resending the email

2014-12-03 Thread Simon Zehnder
Katherine, for a deeper understanding of differing values it makes sense to provide the list at least with an online description of the corresponding functions used in Minitab and SPSS… Best Simon On 03 Dec 2014, at 10:45, Katherine Gobin via R-help r-help@r-project.org wrote: Dear R forum

Re: [R] Building R for better performance

2014-03-06 Thread Simon Zehnder
-Original Message- From: Simon Zehnder [mailto:szehn...@uni-bonn.de] Sent: Wednesday, March 05, 2014 3:55 AM To: Anspach, Jonathan P Cc: r-help@r-project.org Subject: Re: [R] Building R for better performance Jonathan, I myself tried something like this - comparing gcc, clang

Re: [R] Building R for better performance

2014-03-05 Thread Simon Zehnder
Jonathan, I myself tried something like this - comparing gcc, clang and intel on a Mac. From my experiences in HPC on the university cluster (where we also use the Xeon Phi, Landeshochleistungscluster University RWTH Aachen), the Intel compiler has better code optimization in regard to

Re: [R] Where did lost variables go

2013-12-31 Thread Simon Zehnder
A reproducible example would do well here David Best Simon On 31 Dec 2013, at 02:42, David Parkhurst parkh...@indiana.edu wrote: I have several variables in a data frame that aren't listed by ls() after I attach that data frame. Where did they go, and how can I stop the hidden ones from

Re: [R] Estimation of AR(1) model by QML.

2013-12-30 Thread Simon Zehnder
Why not using optim on the likelihood in a) with normally distributed standard errors and for b) optim with a likelihood with t(3)-distributed standard errors? Best Simon On 30 Dec 2013, at 21:19, Xuse Chuse chus...@gmail.com wrote: Dear Users, I am trying to estimate a model

Re: [R] Milliken and Johnson Unbalanced Machines

2013-12-30 Thread Simon Zehnder
I don’t know anything about this topic, but looking into this book:

Re: [R] testing for bimodal and for dip in between modes in R

2013-11-25 Thread Simon Zehnder
Testing for bimodality is rather testing for unimodality. Hartigan and Hartigan (1985) presented the Dip-Test which is implemented in the R package DipTest with a much better approximation of the test distribution. If the test statistic is too high unimodality is rejected. To estimate the dip

Re: [R] MM estimator

2013-11-14 Thread Simon Zehnder
Thanks Martin, for making this clear to me, I thought of Pearson’s Method-of-Moments. On 14 Nov 2013, at 16:08, Martin Maechler maech...@stat.math.ethz.ch wrote: SZ == Simon Zehnder szehn...@uni-bonn.de on Thu, 14 Nov 2013 08:52:16 +0100 writes: SZ Check the gmm package

Re: [R] optimization: multiple assignment problem

2013-11-14 Thread Simon Zehnder
It would be more clear if you tell, what you want to do instead of what you do not want to do. If you start with a usual cost matrix (whatever cost function you have) and you have to assign N to N this reduces to the well-known Munkre’s algorithm (see for example:

Re: [R] issues with calling predict.coxph.penal (survival) inside a function - subset-vector not found. Because of NextMethod?

2013-11-13 Thread Simon Zehnder
Works for me: predicting_function(fit2,test1) 1 2 3 4 5 6 7 -1.0481141 0.1495946 0.4492597 0.4492597 0.9982492 -0.4991246 -0.4991246 Best Simon On 13 Nov 2013, at 15:46, julian.bo...@elitepartner.de wrote: Hello everyone,

Re: [R] MM estmator

2013-11-13 Thread Simon Zehnder
Check the gmm package with a weighting matrix equal to the identity. Best Simon On 14 Nov 2013, at 04:37, IZHAK shabsogh ishaqb...@yahoo.com wrote: hi I have a nonlinear regression model with two parameter, i have estimated using nls in R and i want to also find the estimate using MM,

Re: [R] S4; Setter function is not chaning slot value as expected

2013-11-09 Thread Simon Zehnder
If you want to set a slot you have to refer to it: ac@CustomerID - “54321” or you use your setter: ac - CustomerID(ac, “54321”) What you did was creating a new symbol CustomerID referring to the String “54321” CustomerID - “54321” CustomerID [1] “54321” Best Simon On 09 Nov 2013, at

Re: [R] S4 vs S3. New Package

2013-11-09 Thread Simon Zehnder
This depends very often of on the developer and what he is comfortable with. I like S4 classes, as I come from C++ and S4 classes approximate C++ classes at least more than S3 classes do (Reference Classes would do so even more and I know very good R programmers liking these most). 1) I wrote

Re: [R] select .txt from .txt in a directory

2013-11-08 Thread Simon Zehnder
I do not understand the question. If you already know the names what is the problem to select the files by names? If you have the names but not inside of R you have to find a name pattern to avoid typing them in. Is there a pattern, e.g. da.txt, db.txt, dc.txt? On 08 Nov 2013, at 18:33,

Re: [R] select .txt from .txt in a directory

2013-11-08 Thread Simon Zehnder
. Assume that I know the names of some of the files I want to select from the 300 txt files. How can I do this in R. Atem. On Friday, November 8, 2013 11:44 AM, Simon Zehnder szehn...@uni-bonn.de wrote: I do not understand the question. If you already know the names what is the problem

Re: [R] select .txt from .txt in a directory

2013-11-08 Thread Simon Zehnder
, 2013 11:54 AM, Simon Zehnder szehn...@uni-bonn.de wrote: If you want to type in the names by hand, you can simply use read.table to load them into R … I still don’t get the aim of your text file handling On 08 Nov 2013, at 18:51, Zilefac Elvis zilefacel...@yahoo.com wrote: All files

Re: [R] R with openblas and atlas

2013-11-01 Thread Simon Zehnder
There is no R code following On 01 Nov 2013, at 05:34, Li Bowen bowenl...@gmail.com wrote: Hi, I have been trying to build R with optimized BLAS library. I am using a Ubuntu 13.10 x86_64 desktop, on which I am able to build R with openblas without any problem: #BEGIN_SRC sh

Re: [R] Combinations of values in two columns

2013-11-01 Thread Simon Zehnder
You could use the data.table package require(data.table) DT - data.table(Friend1 = sample(LETTERS, 10, replace = TRUE), Friend2 = sample(LETTERS, 10, replace = TRUE), Indicator = 1) ALL - data.table(unique(expand.grid(DT))) setkey(ALL) OTHERS - ALL[!DT] OTHERS[, Indicator := 0] RESULT -

Re: [R] set difference between two data frames

2013-10-31 Thread Simon Zehnder
You could e.g. take the data.table package (every data.table is a data.frame) and make a join: dt.x - data.table(x) dt.y - data.table(y) merge.xy - x[y, nomatch = 0] diff.xy - x[!merge.xy] On 31 Oct 2013, at 21:41, Yasin Gocgun entropy...@gmail.com wrote: Thanks. Actually, I forgot to add

Re: [R] speed of makeCluster (package parallel)

2013-10-28 Thread Simon Zehnder
See library(help = parallel”) On 28 Oct 2013, at 17:19, Arnaud Mosnier a.mosn...@gmail.com wrote: Hi all, I am quite new in the world of parallelization and I wonder if there is a way to increase the speed of creation of a parallel socket cluster. The time spend to include threads

Re: [R] speed of makeCluster (package parallel)

2013-10-28 Thread Simon Zehnder
I wanted. May be you can be more specific on a part of the document that can provide me hints ! Arnaud 2013/10/28 Simon Zehnder szehn...@uni-bonn.de See library(help = parallel”) On 28 Oct 2013, at 17:19, Arnaud Mosnier a.mosn...@gmail.com wrote: Hi all, I am quite new

Re: [R] DEoptim inconsistent output

2013-09-29 Thread Simon Zehnder
It's always a good thing to trace the optimization. There can be a lot of reasons: Is the function correctly implemented? Is it defined for all values? If not, is it defined for all values in the constrained parameter space? Is it defined for the constraint? If it is not defined for the

Re: [R] Memory distribution using foreach

2013-09-27 Thread Simon Zehnder
First of all LSF is a batch scheduling software. It usually expects an .lsf script. Usually the compilers on a cluster are interchangeable via the 'module switch unload module load module' and MPI-2 is the message passing interface standard. This is also rather an topic for the high-performance

Re: [R] Installing R, R packages

2013-09-24 Thread Simon Zehnder
Had yesterday something pretty similar on the 73 installing benchmark: Error in untar2(tarfile, files, list, exdir, restore_times) : incomplete block on file The downloaded source packages are in ‘/private/var/folders/n9/zxfxcd01557dc06bf3c1njy0gn/T/RtmpkwQyuQ/downloaded_packages’

Re: [R] Checking a large data set for normality

2013-09-24 Thread Simon Zehnder
Check the Jarque-Bera Test for univariate testing (http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/tseries/html/jarque.bera.test.html) and Mardia's test for multivariate testing (http://www.inside-r.org/packages/cran/MVN/docs/mardia.test). On Sep 24, 2013, at 6:44 PM, steric

Re: [R] Hope u have some time for 2 more questions

2013-09-20 Thread Simon Zehnder
Hi, as far as I know, there is no limitation on data size in regard to foreach. You should reserve though enough memory for your application on the cluster (via ulimit -s unlimited and ulimit -v unlimited). Furthermore I would check the following: Check if there are two versions of R on the

Re: [R] Renaming variables

2013-09-20 Thread Simon Zehnder
You haven't said yet, what object your 'data file' is. If you mean a data.frame I would use colnames(dataName) - c(Col1Name, col2Name, ….) Best Simon On Sep 20, 2013, at 4:10 PM, Preetam Pal lordpree...@gmail.com wrote: Hi, I guess this is pretty basic. I have 25 variables in the data

Re: [R] callNextMethod with dots argument

2013-09-19 Thread Simon Zehnder
Kien, if you want to add variables in a function definition that is predefined by a Generic and calls CallNextMethod you have to add the '…' argument as well. setMethod(do,signature(a=Achild), function(a,msg,...) { print(do Achild) callNextMethod()

Re: [R] R-3.0.1 g77 errors

2013-09-18 Thread Simon Zehnder
On my systems Linux Scientific and Mac OS X I use as well for the F77 the gfortran compiler and this works. You could give it a trial. Best Simon On Sep 18, 2013, at 3:14 PM, Prigot, Jonathan jpri...@partners.org wrote: I am trying to build R-3.0.1 on our SPARC Solaris 10 system, but it

Re: [R] foreach returns null first object in the list

2013-09-17 Thread Simon Zehnder
Use an extra call to return: post.ls - foreach(i =1:2, .verbose = TRUE) %dopar% { fun - func.list[[i]] if (i == 1) return(fun(Xa, Sa)) if (i == 2) return(fun(Ta, Sa)) } Best Simon On Sep 17, 2013, at 11:55 AM, pakoun pko...@bgc-jena.mpg.de

Re: [R] foreach returns null first object in the list

2013-09-17 Thread Simon Zehnder
Use an extra call to 'return()' as posted below. On Sep 17, 2013, at 5:55 PM, pakoun pko...@bgc-jena.mpg.de wrote: This is the output with the debugging message. I don't really understand what is the problem. post.ls - foreach(i =1:2, .verbose=T) %dopar% { + + fun -

Re: [R] Unrecognized token

2013-09-17 Thread Simon Zehnder
Maybe you should escape the single quotes something like ' id ' ? On Sep 17, 2013, at 6:03 PM, srecko joksimovic sreckojoksimo...@gmail.com wrote: Hi, when I generate query using sqldf library, like this: query = paste(paste(select * from tbl_user where student_id = , id,

Re: [R] set breakpoint in debug

2013-09-16 Thread Simon Zehnder
You could just use debug(f) and then when the Browser opens and the loop begins type 'c', that jumps over the loop to next line after the loop. Best Simon On Sep 16, 2013, at 9:05 PM, Hui Du hui...@dataventures.com wrote: Hi All, I need some help regarding how to set up a breakpoint in

Re: [R] Package installation and path.package

2013-09-09 Thread Simon Zehnder
I am following your suggestion and move this discussion to the R-devel list. Best Simon On Sep 9, 2013, at 7:58 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On 09/09/2013 02:09, David Winsemius wrote: On Sep 8, 2013, at 8:00 AM, Simon Zehnder wrote: Dear R-Users and R-Devels

[R] Package installation and path.package

2013-09-08 Thread Simon Zehnder
Dear R-Users and R-Devels, I am writing right now my own package that makes use of 'tempfile' and there within with 'path.package'. When I install it, I get the error: Error in path.package(mypackage) : none of the packages are loaded. I understand the error, but I would like to have a

Re: [R] [dfoptim] 'Error in fn(ginv(par), ...) : object 'alpha' not found'

2013-09-03 Thread Simon Zehnder
Hi Carlos, your problem is a wrong definition of your Likelihood function. You call symbols in the code (alpha, beta) which have no value assigned to. When L the long calculation in the last lines is assigned to L alpha and beta do not exist. The code below corrects it. But you have a problem

Re: [R] How to catch errors regarding the hessian in 'optim'

2013-09-02 Thread Simon Zehnder
Dear John, thank you very much for your answer. I take a look at these packages (Rvmmin and Rcgmin). That sounds very interesting. For the example: The method relies on data which I always try to avoid to send on the r-help list - not that my data is confidential - but it becomes even more

[R] How to catch errors regarding the hessian in 'optim'

2013-09-01 Thread Simon Zehnder
Dear R-Users and R-Developers, in a comparison between two different estimation approaches I would like to catch errors from optim regarding the hessian matrix. I use optim with method = L-BFGS-B thereby relying on numerical differentiation for the hessian matrix. I do know, that the

Re: [R] Understanding S4 method dispatch

2013-08-14 Thread Simon Zehnder
Ambiguity is indeed detected by R and the user is informed on it. But in the case of Hadley's example, I still believe, that the specific multiple inheritance structure creates this behavior. If you call: showMethods(f) Function: f (package .GlobalEnv) x=A, y=A x=AB, y=AB (inherited from:

Re: [R] Grabbing numbers inside a character string

2013-08-14 Thread Simon Zehnder
Thomas, se ?sub and regular expression. That should make it. Further, see the package gsubfn Best Simon On Aug 14, 2013, at 2:14 PM, Thomas thomas.ches...@nottingham.ac.uk wrote: I have a string that contains something like: ...verified email at neu.edubrCited by

Re: [R] Understanding S4 method dispatch

2013-08-14 Thread Simon Zehnder
Because the signature is always (A,A) or (B,B). Then, as in AB we have A and B and no relationship between A and B, R chooses the method lexicographically. The result is as expected: f for A is chosen. If you would do something like: setClass(A, contains = list) setClass(B, contains = list)

Re: [R] Understanding S4 method dispatch

2013-08-13 Thread Simon Zehnder
Hadley, The class AB inherits from A and from B, but B already inherits from class A. So actually you only have an object of class B in your object of class AB. When you call the function f R looks for a method f for AB objects. It does not find such a method and looks for a method of the

Re: [R] Understanding S4 method dispatch

2013-08-13 Thread Simon Zehnder
If you take an example which works with slots, setClass(A, representation(a = numeric) setClass(B, contains = c(A), representation(b = numeric)) a - new(A, a = 2) b - new(B, a = 3, b = 2) setClass(AB, contains = c(A, B)) new(AB, a = 2, b = 3) You see, that there is only one @a slot, the one

Re: [R] Outliers and overdispersion

2013-08-13 Thread Simon Zehnder
I do not know what you are exactly estimating, but if it is about count models and the model fit gets better when you drop the outliers, it does not say, that the model is now more correct. It just says, if the data were without the outliers, this model would fit good. Overdispersion in count

Re: [R] decimal separator from comma to dot

2013-08-09 Thread Simon Zehnder
Hi, I think this could help you: https://stat.ethz.ch/pipermail/r-help/2008-January/152378.html Best Simon On Aug 9, 2013, at 12:19 PM, maxbre mbres...@arpa.veneto.it wrote: This is my reproducible example df-structure(list(IDANT = c(37837L, 37838L, 37839L, 37840L, 37841L, 37842L,

Re: [R] Method dispatch in S4

2013-08-09 Thread Simon Zehnder
suggest to me to learn from by reading and understanding the code? Where can I find the source code? Best Simon On Aug 8, 2013, at 10:00 PM, Martin Morgan mtmor...@fhcrc.org wrote: On 08/04/2013 02:13 AM, Simon Zehnder wrote: So, I found a solution: First in the initialize method of class C

Re: [R] Method dispatch in S4

2013-08-09 Thread Simon Zehnder
intimidating. Cheers, Bert On Fri, Aug 9, 2013 at 7:40 AM, Simon Zehnder szehn...@uni-bonn.de wrote: Hi Martin, thank you very much for this profound answer! Your added design advice is very helpful, too! For the 'simple example': Sometimes I am still a little overwhelmed from a certain

Re: [R] Method dispatch in S4

2013-08-09 Thread Simon Zehnder
, the advanced IRanges package and the 'toy' StudentGWAS. Martin Cheers, Bert On Fri, Aug 9, 2013 at 7:40 AM, Simon Zehnder szehn...@uni-bonn.de wrote: Hi Martin, thank you very much for this profound answer! Your added design advice is very helpful, too! For the 'simple example

Re: [R] Method dispatch in S4

2013-08-04 Thread Simon Zehnder
, 2013, at 9:43 PM, Simon Zehnder simon.zehn...@googlemail.com wrote: setMethod(initialize, C, function(.Object, value) {.Object@c - value; .Object - callNextMethod(.Object, value); .Object - generateSpec(.Object); return(.Object)}) __ R-help@r

Re: [R] fortran random number

2013-08-04 Thread Simon Zehnder
Hi Filippo, I would advice you to use the RcppArmadillo package - maybe in combination with the inline package. It is extremely fast and very flexible. A simple RNGScope() lets you take the RNG from R. I myself programmed an MCMC sampler with this package and it is much faster, than the one I

[R] Method dispatch in S4

2013-08-03 Thread Simon Zehnder
Dear R-Users and R-Devels, I am struggling with the method dispatch for S4 objects. First I will give a simple example to make clear what the general setting in my project is. Three classes will be build in the example: A is just a simple class. B contains A in a slot and C inherits from B.

[R] R number format with Hmisc and knitr

2013-07-31 Thread Simon Zehnder
Dear R-Users and R-Devels, I have a problem when using knitr in combination with Hmisc. I generate a data.frame which has mixed scientific and non-scientific numbers inside. In my Latex Table I just want to have non-scientific format, so I call latex(myDataFrame, file = '', cdec = c(0, rep(4,

Re: [R] R number format with Hmisc and knitr

2013-07-31 Thread Simon Zehnder
Errata: it must say: latex(myDataFrame, file = '', cdec = c(0, rep(4, NCOL(myDataFrame) - 1)) ) But this does not work. Scientific notation is very robust :) Apologize Simon On Jul 31, 2013, at 5:05 PM, Simon Zehnder szehn...@uni-bonn.de wrote: Dear R-Users and R-Devels, I have

Re: [R] MCMClogit: Cannot calculate marginal likelihood with improper prior

2013-07-29 Thread Simon Zehnder
Hi, what I see so far is that you have specified your user.prior.density correctly. The error comes from the prior precision matrix B0 in combination with the marginal.likelihood set to Laplace. B0, if not explicitly specified, defaults to zero, which results in eigenvalues of zero. If

Re: [R] Hmisc ctable rotate option obsolete?

2013-07-27 Thread Simon Zehnder
So, I downloaded the source files of Hmisc and changed in the file latex.s line 688 'rotate' to 'sideways'. This does the work for landscape ctables in Latex. I also wrote an email to the package maintainer. I consider this thread as solved. Best Simon On Jul 26, 2013, at 5:34 PM, Simon

[R] Hmisc ctable rotate option obsolete?

2013-07-26 Thread Simon Zehnder
Dear R-Users and R-Devels, I may have found a deprecated option for the 'latex' function in the Hmisc package. I am working with Hmisc and knitr and tried the following code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb} \usepackage{ctable}

[R] Check the class of an object

2013-07-23 Thread Simon Zehnder
Dear R-Users and R-Devels, I have large project based on S4 classes. While writing my unit tests I found out, that 'is' cannot test for a specific class, as also inherited classes can be treated as their super classes. I need to do checks for specific classes. What I do right now is sth. like

Re: [R] Check the class of an object

2013-07-23 Thread Simon Zehnder
a structure which is quite complicated let me move to the check I suggested in my first mail. Best Simon On Jul 23, 2013, at 6:15 PM, David Winsemius dwinsem...@comcast.net wrote: On Jul 23, 2013, at 5:36 AM, Simon Zehnder wrote: Dear R-Users and R-Devels, I have large project based

Re: [R] Check the class of an object

2013-07-23 Thread Simon Zehnder
AM, Simon Zehnder wrote: Hi David, thanks for the reply. You are right. Using the %in% is more stable and I gonna change my code. you said you were you were using S4 classes. S4 classes do not report vectors of length != 1, from ?class For objects which have a formal class, its

Re: [R] Check the class of an object

2013-07-23 Thread Simon Zehnder
Hi Hervé, thank you very much for your reply! This makes the different treatment of S3 and S4 objects by 'class' clear. Best Simon On Jul 23, 2013, at 7:20 PM, Hervé Pagès hpa...@fhcrc.org wrote: Hi, On 07/23/2013 09:59 AM, Simon Zehnder wrote: Hi David, thanks for the reply. You

Re: [R] S4 method signature - integer matrix

2013-07-20 Thread Simon Zehnder
:54 AM, Simon Zehnder wrote: Dear R-Users and R-Devels, I am programming a package with S4 classes and I search for a solution of the following problem: If you want an S4 method to await an integer argument you set the signature like this setMethod(myfunction, signature(object

[R] S4 method signature - integer matrix

2013-07-19 Thread Simon Zehnder
Dear R-Users and R-Devels, I am programming a package with S4 classes and I search for a solution of the following problem: If you want an S4 method to await an integer argument you set the signature like this setMethod(myfunction, signature(object = myClass, y = integer), function(object,

Re: [R] 'save' method for S4 class

2013-07-18 Thread Simon Zehnder
Hi Christopher, I think, that save is no generic function like plot, show, etc. So at first you have to determine a generic. setGeneric(save, function(x, file_Path) standardGeneric(save)) Now your definition via setMethod. Best Simon On Jul 18, 2013, at 12:09 PM, Christofer Bogaso

Re: [R] 'save' method for S4 class

2013-07-18 Thread Simon Zehnder
. Thanks and regards, On Thu, Jul 18, 2013 at 4:32 PM, Simon Zehnder szehn...@uni-bonn.de wrote: Hi Christopher, I think, that save is no generic function like plot, show, etc. So at first you have to determine a generic. setGeneric(save, function(x, file_Path) standardGeneric(save

Re: [R] Looking for knitr example for beginner (NO RStudio)

2013-07-18 Thread Simon Zehnder
Hi Mike, I found my way with this little blog: http://yihui.name/knitr/demo/editors/ The .Rnw files are created very well in a Latex editor. Everything else can be easily googled. The command via knitr::knit2pdf works very fine if you use the chunks. If you are trying to compile an Rtex file,

Re: [R] Looking for knitr example for beginner (NO RStudio)

2013-07-18 Thread Simon Zehnder
On Thu, Jul 18, 2013 at 3:31 PM, Simon Zehnder szehn...@uni-bonn.de wrote: Hi Mike, I found my way with this little blog: http://yihui.name/knitr/demo/editors/ The .Rnw files are created very well in a Latex editor. Everything else can be easily googled. The command via knitr::knit2pdf

Re: [R] Looking for knitr example for beginner (NO RStudio)

2013-07-18 Thread Simon Zehnder
Hi Mike, if you browse the folders, you find always the Rscript binary (the executable) under /Library/Frameworks/R.framework/Versions/.../Resources/Rscript. Do not forget to give your tex file the extension .Rnw! Then surround each Rcode with write here a nameadd later further options

Re: [R] Serialize data.frame to database

2013-07-16 Thread Simon Zehnder
#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Simon Zehnder szehn...@uni-bonn.de wrote: Dear R-Users, I need a very fast

Re: [R] Serialize data.frame to database

2013-07-16 Thread Simon Zehnder
dbWriteTable( db, frames, iris ) does what you want? On Monday 15 July 2013 23:43:18 Simon Zehnder wrote: Dear R-Users, I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to store this data to an SQLite database

Re: [R] Setting Derived Class Slots

2013-07-16 Thread Simon Zehnder
Hi Steve, it seems to me, that you want to pass an object inside of getDelayProfile. In this case you must use setReplaceMethod(getDelayProfile-,) in your definition inside the virtual and of course also in the specification of OP_Appt. R does not know, that your function should give back

Re: [R] Fitting Mixture distributions

2013-07-16 Thread Simon Zehnder
Hi Tjun Kiat Teo, you try to fit a Normal mixture to some data. The Normal mixture is very delicate when it comes to parameter search: If the variance gets closer and closer to zero, the log Likelihood becomes larger and larger for any values of the remaining parameters. Furthermore for the EM

[R] Serialize data.frame to database

2013-07-15 Thread Simon Zehnder
Dear R-Users, I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to store this data to an SQLite database. This is what I tried to do: library(RSQLite) con - dbDriver(SQLite) db - dbConnect(con, test) dbSendQuery(db, 'CREATE TABLE

Re: [R] Set window title for plot on any OS

2013-07-14 Thread Simon Zehnder
at fortune(Lewis Carroll) cheers, Rolf Turner On 14/07/13 01:45, Simon Zehnder wrote: Hi Duncan, thank you very much for your advice! That makes it all work. I check in addition for a title argument in the device via if (any(names(getOption(device)) == TRUE

[R] Set window title for plot on any OS

2013-07-13 Thread Simon Zehnder
Dear R-Users, I am writing a package using S4 classes. In the generic method plot I want to set the title for the plotting window as I will have several windows and window titles help the users to distinguish the graphics without putting a title into the plot itself (this can be done by users

Re: [R] Set window title for plot on any OS

2013-07-13 Thread Simon Zehnder
...@gmail.com wrote: On 13-07-13 1:33 PM, Simon Zehnder wrote: Dear R-Users, I am writing a package using S4 classes. In the generic method plot I want to set the title for the plotting window as I will have several windows and window titles help the users to distinguish the graphics without

Re: [R] Optim seems not to work properly in foreach

2013-06-06 Thread Simon Zehnder
are tested this often, that the probabilitty is almost 1, the error is in your own code. Thanks for the help Simon On Jun 3, 2013, at 10:53 PM, ilai ke...@math.montana.edu wrote: On Mon, Jun 3, 2013 at 11:37 AM, Simon Zehnder szehn...@uni-bonn.de ... [Some not minimal, self contained

Re: [R] 3.0.1 update and compiler package

2013-06-04 Thread Simon Zehnder
Hi Christoph, do you install from sources? Best Simon On Jun 4, 2013, at 10:41 AM, Christoph Knapp christoph.knap...@gmail.com wrote: Hi, reinstalling R did not help. It still will not update the same packages. I attached the terminal output. There were no errors while I was installing

Re: [R] 3.0.1 update and compiler package

2013-06-04 Thread Simon Zehnder
me that those packages were not installed when I used the terminal to start R. Drove me crazy for a while because I could use them in Rstudio so I was sure they were installed. Do you think this could also cause this? Christoph On 04/06/13 21:13, Simon Zehnder wrote: Hi Christoph

[R] Optim seems not to work properly in foreach

2013-06-03 Thread Simon Zehnder
Hi guys, I am working now for several years in R and I would say I manage things pretty easily, but with the foreach loop I have my problems. I call for a simulation a double foreach loop and this works fine. Inside the second loop (which I plan to parallelize later on) I call Rs

Re: [R] Count function calls

2013-03-07 Thread Simon Zehnder
the global assignment operator '-' as already suggested by William to output diagnostics. Best, Giovanni -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Simon Zehnder Sent: Tuesday, February 26, 2013 2:53 AM To: r-help@r

[R] S4-classes: Assignment of values to slots by reference

2013-03-01 Thread Simon Zehnder
Dear R-users, I am working on a project that uses S4-classes. At some point I encountered the problem - well known to R - that I have to pass 3 different objects to a function, that should modify several slots of them and of course there is no passing by reference in R. Then I read this

Re: [R] Count function calls

2013-02-27 Thread Simon Zehnder
. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Simon Zehnder Sent: Tuesday, February 26, 2013 2:53 AM To: r-help@r-project.org help Subject: [R] Count function

[R] Count function calls

2013-02-26 Thread Simon Zehnder
Dear R-users, I have the following problem: I am running the function 'pvcm' from the 'plm' Panel Data package. Inside this function 'solve' is called and gives for a certain individual data series an exception because of singularity. I would like to know which individual data series causes

Re: [R] Armadillo error in R extension

2013-02-02 Thread Simon Zehnder
1, 2013, at 8:38 PM, Simon Zehnder szehn...@uni-bonn.de wrote: Is there anyway with some experience in using armadillo in R C++ extensions? My problem is the following: I programmed a function in a header looking like #include armadillo inline arma::vec foo(input) { ... do

[R] Armadillo error in R extension

2013-02-01 Thread Simon Zehnder
Is there anyway with some experience in using armadillo in R C++ extensions? My problem is the following: I programmed a function in a header looking like #include armadillo inline arma::vec foo(input) { ... do something return an arma::vec object } compiling this

[R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think a little harder on implementation style (especially to spare users complex

Re: [R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Dear Barry, thank you very much for this information. This looks pretty interesting! Best Simon On Jan 31, 2013, at 4:09 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: it lets you do: (a~b~c) = foo() Mistook. should be: (a~b~c) %=% foo() because it defines the %=%

Re: [R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Hi Barry, this actually a good idea, to put them together! Probably even creating an object containing both of them. Haven't thought about it before. Best Simon On Jan 31, 2013, at 3:49 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Thu, Jan 31, 2013 at 11:52 AM, Simon Zehnder

[R] Irreproducible exception in R extension

2012-12-28 Thread Simon Zehnder
Dear R-Users, I am having some trouble running an R extension on our cluster (linux). I call C++ code in which I use a) the Scythe Statistical Library and b) OpenMP. Most of the jobs run without a problem, but some arbitrary jobs throw an exception of the kind printed below while running in a

[R] Irreproducible exception in R extension

2012-12-28 Thread Simon Zehnder
Dear R-Users, I am having some trouble running an R extension on our cluster (linux). I call C++ code in which I use a) the Scythe Statistical Library and b) OpenMP. Most of the jobs run without a problem, but some arbitrary jobs throw an exception of the kind printed below while running in a

Re: [R] Generating an autocorrelated binary variable

2012-10-02 Thread Simon Zehnder
. Note that the sample proportions are 0.484 and 0.485 for X and Y respectively. These values do not differ significantly from 0.5. cheers, Rolf Turner On 28/09/12 08:26, Simon Zehnder wrote: Hi R-fellows, I am trying to simulate a multivariate correlated sample via

[R] Autocorrelated binary variable

2012-09-27 Thread Simon Zehnder
Hi R-fellows, I am trying to simulate a multivariate correlated sample via the Gaussian copula method. One variable is a binary variable, that should be autocorrelated. The autocorrelation should be rho = 0.2. Furthermore, the overall probability to get either outcome of the binary variable

[R] Generating an autocorrelated binary variable

2012-09-27 Thread Simon Zehnder
Hi R-fellows, I am trying to simulate a multivariate correlated sample via the Gaussian copula method. One variable is a binary variable, that should be autocorrelated. The autocorrelation should be rho = 0.2. Furthermore, the overall probability to get either outcome of the binary variable

[R] openmp on R?

2011-09-19 Thread Simon Zehnder
Dear R-Users, in the configuring file of R on the supercomputer I am using I found a line --disable-openmp (version R 2.13.1) Is there a possibility to enable this when I let run a BATCH file via R CMD? Thanks for comments! Simon __

[R] Problem with memory consuming algorithm

2011-09-16 Thread Simon Zehnder
Hi guyz, I have serious problems with an algorithm I let run on a supercomputer: You find the functions under the following URLs: simuFunctionCaller: http://pastebin.com/6gw2fJFb calls Function simuFunctionNBM (http://pastebin.com/QeJDUnqx) after reading a csv-file ordered like the

[R] Exception in NeweyWest - Pre-Whitening necessary?

2011-09-09 Thread Simon Zehnder
Hi guyz, I have run my algorithm in R (see http://pastebin.com/q84Tujfg) and got the following error: Error in ar.ols(x, aic = aic, order.max = order.max, na.action = na.action, : 'order.max' must be 'n.used' I am pretty sure, that the error comes from the NeweyWest function in line 45,

Re: [R] Exception while using NeweyWest function with doMC

2011-08-30 Thread Simon Zehnder
-- Message: 32 Date: Sat, 27 Aug 2011 21:37:55 +0200 From: Simon Zehnder simon.zehn...@googlemail.com To: r-help@r-project.org Subject: [R] Exception while using NeweyWest function with doMC Message-ID: cagqvrp_gk+t0owbv1ste-y0zafmi9s_zwqrxyxugsui18ms...@mail.gmail.com Content-Type: text

Re: [R] Descriptive Stats from Data Frame

2011-08-30 Thread Simon Zehnder
Hi Rich, I do not know what u really want, because it seems to me, u want to calculate the mean of all rows, where the chemical is Arsenic?? But try this to get a little more inside: mean(chemdata$quant[chemdata$param==Arsenic]) The vector chemdata[chemdata$param==Arsenic,] is a logical

[R] Exception while using NeweyWest function with doMC

2011-08-27 Thread Simon Zehnder
Dear R users, I am using R right now for a simulation of a model that needs a lot of memory. Therefore I use the *bigmemory* package and - to make it faster - the *doMC* package. See my code posted on http://pastebin.com/dFRGdNrG Now, if I use the foreach loop with the addon %do% (for sequential