Re: [R] nlminb() - how do I constrain the parameter vector properly?

2013-10-21 Thread Steven LeBlanc
On Oct 20, 2013, at 9:54 PM, Mark Leeds marklee...@gmail.com wrote: Bill: I didn't look at the code but I think the OP means that during the nlminb algorithm, the variance covariance parameters hit values such that the covariance matrix estimate becomes negative definite. Yes, that is

Re: [R] Gaussian Quadrature for arbitrary PDF

2013-10-21 Thread Marino David
Greatly enrich my mind. Thank you! David 2013/10/16 Spencer Graves spencer.gra...@structuremonitoring.com On 10/15/2013 5:37 PM, Marino David wrote: Hi Spencer: Thanks for your interpretation again and again. Your statement does enable me to have a good understanding of Gaussian

Re: [R] Errore : requires numeric/complex matrix/vector arguments

2013-10-21 Thread PIKAL Petr
Hi From your first post if any of variables is not numeric this command mY-cbind(G, T, Y, news) makes mY also nonumeric. so look at structure of D data.frame which results from reading your csv file by str(D) Regards Petr -Original Message- From: r-help-boun...@r-project.org

Re: [R] Conflict between Accelerate BLAS and package 'stats'

2013-10-21 Thread Prof Brian Ripley
On 21/10/2013 04:18, David Degras wrote: Hi All, After successfully setting up the Accelerate BLAS library via 'UNsucessfully' ... This is a question for R-sig-MAC: see the posting guide, and you need to ask how to achieve whatever you are trying to do, rather than tell us how you broke

[R] Reproducing density(..., kernel='rectangular', width=1) using convolve? (for educational purposes)

2013-10-21 Thread Tal Galili
Hello dear R-help members, I am currently teaching students on kernel density estimators, and I was hoping to show them an animation of the convolution which is taking place in the density function. I wrote a (somewhat clunky) piece of code to reproduce the density function, but I seem to get

Re: [R] nlminb() - how do I constrain the parameter vector properly?

2013-10-21 Thread Mark Leeds
my mistake. since nlminb is minimizing, it should be +Inf ( so that the likelihood is large ) as you pointed out. Note that this approach is a heuristic and may not work all the time. On Mon, Oct 21, 2013 at 3:01 AM, Steven LeBlanc ores...@gmail.com wrote: On Oct 20, 2013, at

Re: [R] blod dot size and name in plot

2013-10-21 Thread S Ellison
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of eliza botto Sent: 19 October 2013 22:27 To: r-help@r-project.org Subject: [R] blod dot size and name in plot Dear useRs,I have the following data z of two variables x(z[,1])

Re: [R] nlminb() - how do I constrain the parameter vector properly?

2013-10-21 Thread Prof J C Nash (U30A)
This is one area where more internal communication between the objective function (inadmissible inputs) and optimizer (e.g., Quasi-Newton) is needed. This is NOT done at the moment in R, nor in most software. An area for RD. In Nash and Walker-Smith (1987) we did some of this in BASIC back in

[R] merging matrices

2013-10-21 Thread Mohammad Goodarzi
Dear all, I have to load more than 1000 matrices from desktop which all of them have the same size. If I do it manually, it would be very hard, can you please guide me how to load them and merge them together ? for example I want to put them one after another X1 X2 X3 etc Many thanks, Mohammad

[R] Problem to understand calculation of loglikelihood in the ramps package

2013-10-21 Thread zhe zhao
Dear R, We are trying to understand the calculation of loglikelihood in the ramps package. Our calculations do not agree with the package's. Can anyone explain why not? Here's an example using a small data set. # create small dataset library(ramps) data(NURE) ## NURE is included in ramps

Re: [R] Removing duplicates dates matched on another column

2013-10-21 Thread arun
Hi, May be this helps: dat1 - structure( res - dat1[!(duplicated(dat1$date) dat1$admit==0),] A.K. I want to remove duplicate dates if the value of admit is 0. How could I realize this in R?  Reproducible sample data is here: structure(list(date = structure(c(13879, 13879, 13880, 13880,

Re: [R] merging matrices

2013-10-21 Thread Bert Gunter
Have you read An Introduction to R (ships with R) or any R web tutorials to learn how R works? If not, don't you think you should before posting here? Your question appears to be rather basic. Cheers, Bert On Mon, Oct 21, 2013 at 3:18 AM, Mohammad Goodarzi mohammad.goda...@gmail.com wrote: Dear

Re: [R] Problem to understand calculation of loglikelihood in the ramps package

2013-10-21 Thread Bert Gunter
You may get an answer here, but this appears to be something that you should address to the package maintainer or package author. Cheers, Bert On Mon, Oct 21, 2013 at 7:04 AM, zhe zhao zzgt2...@gmail.com wrote: Dear R, We are trying to understand the calculation of loglikelihood in the ramps

[R] plot correlation matrix

2013-10-21 Thread Alaios
Hi all, I am having 4 vectors like Data: num [1:4, 1:32] -82.8 -81.8 -75.5 -107.6 -87.6 ...  and I want to calculate the correlation between those. Is there a graphical way in R to plot the correlations or not? I would like to thank you in advance for your help Regards Alex

Re: [R] nlminb() - how do I constrain the parameter vector properly?

2013-10-21 Thread William Dunlap
Try defining the function theta345toSigma - function(theta) { cholSigma - cbind(c(theta[3], 0), c(theta[4], theta[5])) crossprod(cholSigma) # t(cholSigma) %*% cholSigma) } This creates a positive definite matrix for any theta (and any positive definite matrix has such a

Re: [R] nlminb() - how do I constrain the parameter vector properly?

2013-10-21 Thread Mark Leeds
thanks bill. that's a neat trick that I haven't seen before. now I see what you're saying much more clearly. steven: bill's method should be faster than mine because it won't have rejection iterations like my idea will. On Mon, Oct 21, 2013 at 10:52 AM, William Dunlap wdun...@tibco.com wrote:

Re: [R] merging matrices

2013-10-21 Thread jim holtman
?list.files ?read.table ?rbind Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Oct 21, 2013 at 6:18 AM, Mohammad Goodarzi mohammad.goda...@gmail.com wrote: Dear all, I have to load more than 1000

[R] Am I working with regularly spaced time series?

2013-10-21 Thread Weiwu Zhang
My data is sampled once per minute. There are invalid samples, leaving a lot of holes in the samples, successful sample is around 80% of all minutes in a day. and during the last 4 months sampling, one month's data was stored on a harddisk that failed, leaving a month's gap in between. So am I

Re: [R] list and -

2013-10-21 Thread Greg Snow
See fortune(174). It is best to avoid using '-', if you tell us what you are trying to accomplish then we may be able to provide a better means to accomplish it. On Sat, Oct 19, 2013 at 10:28 PM, Taiyun Wei weitai...@gmail.com wrote: Dear All, opt = list() opt$aa - TRUE Error in opt$aa -

Re: [R] nlminb() - how do I constrain the parameter vector properly?

2013-10-21 Thread William Dunlap
[I added r-help to the cc again. Please keep the replies on the list as there are others who can contribute to or learn from them.] I also learned you have to be very careful with the starting value, as the simple identity matrix becomes singular under the transformation. That is why I

Re: [R] plot correlation matrix

2013-10-21 Thread Kevin Wright
You could try the corrgram or corrplot packages. kw On Mon, Oct 21, 2013 at 9:45 AM, Alaios ala...@yahoo.com wrote: Hi all, I am having 4 vectors like Data: num [1:4, 1:32] -82.8 -81.8 -75.5 -107.6 -87.6 ... and I want to calculate the correlation between those. Is there a graphical

[R] Problem with coordinates when trying to draw lines into a raster (image) file

2013-10-21 Thread Rick Turner
Hi All, I am struggling with something, and could use some help I have a scenario where I need to draw lines onto a base image using R – briefly, the image has what amounts to an outline ‘map’ of locations, and the lines will correspond to ‘routes’ between two

[R] Predicting hurdle model results on spatial scale

2013-10-21 Thread Lauria, Valentina
Dear List, I apologise in advance for all my questions. I am interested to predict the habitat selection of fish species using the hurdle model. I know that I can perform this in R with the function predict.hurdle() on newdata, however how this work is not entirely clear. Usually with a

[R] Aggregate values in one dataframe into a list of vectors of different sieze

2013-10-21 Thread sartene
Hi everyone, I have a data frame that is quite huge (dozens of millions of lines). It looks like this : Name      Value Name1    156 Name2    458963 Name3    758 ... Name143 89325 Name1     4678 Name42   766 Name144 777 ... Name2     46767 ... Each name and and value

[R] tr: Aggregate values in one dataframe into a list of vectors of different sieze

2013-10-21 Thread sartene
I just found out what I was looking for, aggregate did the trick: AggregatedList - aggregate(data = Sample, Value ~ Name, list) Hope this will help someone else! Sartene Bel Message du 21/10/13 à 16h29 De : sart...@voila.fr A : r-help@r-project.org Copie à : Objet : Aggregate values in

[R] Statistical software interoperability meeting

2013-10-21 Thread Daniel Farewell
The British and Irish Region of the International Biometric Society would like to bring your attention to a half-day meeting on Statistical Software Interoperability on Thursday 14th November 2013 at the headquarters of the Royal Statistical Society, Errol Street, London, UK. Please see

Re: [R] R-help Digest, Vol 128, Issue 22

2013-10-21 Thread Mark Leeds
hi john. I knew it wasn't that simple and was thinking of asking you to comment. so thanks for commenting. any good references are appreciated also. In the various texts I have, this issue is seldom talked about. On Mon, Oct 21, 2013 at 8:43 AM, Prof J C Nash (U30A) nas...@uottawa.cawrote:

[R] About integrating R inside a C++ software

2013-10-21 Thread Tambellini William
Hi, We are a company developing a software mainly in C++. We want to integrate R inside our software in order to use mainly the engine (usual stats as mean, sigma, Pearson, outlier detection, CPA, multivariate, ...) and probably later the chart solution. Of course we don't want to

Re: [R] nlminb() - how do I constrain the parameter vector properly?

2013-10-21 Thread Mark Leeds
Steven: I'm not sure if it makes a difference but you might want to start off with the square root of sigmaStart because that will really start you off with sigmaStart. Essentially, what Bill is doing is a reparameterization using the correlation and the 2 standard deviations so compute those

Re: [R] Data Manipulation in R

2013-10-21 Thread Anamika Chaudhuri
Hi Arun: Thanks for your help. Seperate files are being created by concatenating the rows from the two files but I was looking to have them as columns rather than text. This is the way it appears in Excel with row # at the beginning. X Y1 Y2 1 1 4 0 20 17 1 20 52 15 18 Ideally I would like it to

Re: [R] About integrating R inside a C++ software

2013-10-21 Thread Jeff Newmiller
Don't cross-post. If discussed further, this should probably be in r-devel, but I am not on that list. Also, what is your question? I don't really see a question here. It might be along the lines of what technical solutions others like, but your research seems thorough enough for you to apply

Re: [R] merging matrices

2013-10-21 Thread Carl Witthoft
If you have over a thousand files on your desktop, you have bigger problems than just how to load them into R. Where do these files come from, and why do you want to merge them into a single entity? -- View this message in context:

Re: [R] Data Manipulation in R

2013-10-21 Thread arun
Hi, I am getting this.  res - lapply(seq_len(nrow(Y1)),function(i) {dat - data.frame(X=i,Y1=unlist(Y1[i,]),Y2=unlist(Y2[i,])); row.names(dat) - 1:nrow(dat); write.csv(dat,paste0(Anam,i,.csv),row.names=FALSE,quote=FALSE)}) dat1 - read.csv(Anam1.csv,header=TRUE)  dat1   X Y1 Y2 1 1  4 20 2

Re: [R] help creating a simple function to rename columns

2013-10-21 Thread Carl Witthoft
Steve E. wrote Hi R users, I am having some trouble with a very simple function that I hope that you might be able to help me with (and, really, to shed some light on how functions work generally). I have a series of very small 2-column data frames of which I need to change the column

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-21 Thread peter dalgaard
On Oct 19, 2013, at 19:03 , Duncan Murdoch wrote: On 13-10-18 1:54 PM, Bert Gunter wrote: Yes, similar, but better, as match.call() will get unwanted named arguments, too. However, I do not understand the substitute(...()) idiom. Would you care to explain it? (No is an acceptable

[R] Error in heatmap

2013-10-21 Thread David Romero
Hi, Could you please help? Heatmap doesn't work with: heatmap(as.matrix(SPIV2),na.rm = T) Error in hclustfun(distfun(x)) : NA/NaN/Inf in foreign function call (arg 11) There are no 0 data rows or column Thanks a lot Regards ---

Re: [R] Recovering object names when using the ... argument in a fn XXXX

2013-10-21 Thread William Dunlap
Just curious, does substitute(...()) buy you anything that you don't get from the straightforward match.call(expand.dots=FALSE)$... substitute() makes is easier to bury the idiom in a function so you don't have to remember the weird syntax. dotdotdot1 - function(...)substitute(...())

Re: [R] help creating a simple function to rename columns

2013-10-21 Thread David Winsemius
On Oct 21, 2013, at 11:45 AM, Carl Witthoft wrote: Steve E. wrote Hi R users, I am having some trouble with a very simple function that I hope that you might be able to help me with (and, really, to shed some light on how functions work generally). I have a series of very small 2-column

[R] speeding up sum of squared differences calculation

2013-10-21 Thread Bos, Roger
All, I am using a sum of squared differences in the objective function of an optimization problem I am doing and I have managed to speed it up using the outer function versus the nested for loops, but my suspicion is that the calculation could be done even quicker. Please see the code below

Re: [R] speeding up

2013-10-21 Thread Ken Knoblauch
Bos, Roger roger.bos at rothschild.com writes: I am using a sum of squared differences in the objective function of an optimization problem I am doing and I have managed to speed it up using the outer function versus the nested for loops, but my suspicion is that the calculation could be

Re: [R] speeding up

2013-10-21 Thread Ken Knoblauch
Ken Knoblauch ken.knoblauch at inserm.fr writes: Bos, Roger roger.bos at rothschild.com writes: I am using a sum of squared differences in the objective function of an optimization problem I am doing and I have managed to speed it up using the outer function versus the nested for

[R] Installation of 3.0.2

2013-10-21 Thread Berk, Richard
I am trying to update R from 3.0.1 to 3.0.2. The installer quits saying I need a Mac OS of at least 10.6. I have 10.8.5. I have tried several times over a period of 2 weeks hoping the problem would be fixed. Suggestions? Richard A. Berk be...@wharton.upenn.edumailto:be...@wharton.upenn.edu

[R] Calculating Blups Using R (lem4 packages)

2013-10-21 Thread Geraldo Carvalho Jr
Hi, I have some field data from a randomized complete block design trial in two locations and I would like to calculate BLUPs and BLUEs from this data. I´ve run some analysis using the lem4 package but I am not too sure about the results I got. When I calculate the BLUPs considering

[R] May I send a zip attachment to a post?

2013-10-21 Thread Hurr
May I send a .zip file attached to a post? -- View this message in context: http://r.789695.n4.nabble.com/May-I-send-a-zip-attachment-to-a-post-tp4678742.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] May I send a zip attachment to a post?

2013-10-21 Thread David Winsemius
On Oct 21, 2013, at 2:15 PM, Hurr wrote: May I send a .zip file attached to a post? No. -- David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Calculating Blups Using R (lem4 packages)

2013-10-21 Thread Bert Gunter
I suggest you post to the R-sig-Mixed-models list rather than here. It is specifically devoted to mixed models and you are more likely to get an (reliable!) answer there. Cheers, Bert On Mon, Oct 21, 2013 at 1:11 PM, Geraldo Carvalho Jr g.acjun...@gmail.com wrote: Hi, I have some field data

[R] post hoc test to a significant Kruskal-Wallis test package asbio function pairw.kw()

2013-10-21 Thread luigi marongiu
Dear all, I am trying to apply a post hoc test to a significant Kruskal-Wallis test. I eventually found the function ‘pairw.kw()’ of the package “asbio”. This function has the following syntax: pairw.kw(y, x, conf) Arguments y The response variable. A vector of quantitative responses.

Re: [R] Installation of 3.0.2

2013-10-21 Thread Jeff Newmiller
Perhaps ask on r-sig-mac? --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live:

[R] How do I use simple calls to java methods?

2013-10-21 Thread Hurr
I need to learn how to set up two methods (java functions) so I can call them from R. Currently I just copy and paste R code into the R console. A little piece of the R code inside a loop is: linTm - linTimOfCalStg(dta[i,timCol],tlev) calCk - calStgOfLinTim(linTm,tlev)

[R] cor matrix in multivariate regression

2013-10-21 Thread Suyan Tian
Sorry to bother, I want to construct a correlation matrix in multivariate regression (several dependent variables and they are correlated in some ways) like the followings, 1 0.8 0 0 … 0 0 0.8 1 0 0 …0 0 00 1 0.8 … 0 0 0 0 0.8 1 … 0 0 . . .

[R] left transpose

2013-10-21 Thread Vokey, John
useRs, I frequently require the following transform of a matrix that I call a leftTranspose: -- transposes x such that the last items of each row become -- the first items in each column. E.g., -- a b c d -- e f g h -- becomes: -- d h -- c g -- b f -- a e because

Re: [R] left transpose

2013-10-21 Thread Jorge I Velez
Dear Dr. Vokey, Here is one approach, although may not be the more efficient: x - matrix(1:8, ncol = 4) x # [,1] [,2] [,3] [,4] #[1,]1357 #[2,]2468 t(x[, ncol(x):1]) # [,1] [,2] #[1,]78 #[2,]56 #[3,]34 #[4,]12

Re: [R] post hoc test to a significant Kruskal-Wallis test package asbio function pairw.kw()

2013-10-21 Thread arun
Hi, Try: pairw.kw(y,factor(x),conf=.95) A.K. On Monday, October 21, 2013 7:10 PM, luigi marongiu marongiu.lu...@gmail.com wrote: Dear all, I am trying to apply a post hoc test to a significant Kruskal-Wallis test. I eventually found the function ‘pairw.kw()’ of the package “asbio”. This

Re: [R] post hoc test to a significant Kruskal-Wallis test package asbio function pairw.kw()

2013-10-21 Thread Andrew Koeser
Luigi, agricolae has a nice function for this with the post hoc test as part of the output. AKK On 10/21/2013 11:12 PM, arun wrote: Hi, Try: pairw.kw(y,factor(x),conf=.95) A.K. On Monday, October 21, 2013 7:10 PM, luigi marongiu marongiu.lu...@gmail.com wrote: Dear all, I am trying

Re: [R] plot correlation matrix

2013-10-21 Thread Jim Lemon
On 10/22/2013 01:45 AM, Alaios wrote: Hi all, I am having 4 vectors like Data: num [1:4, 1:32] -82.8 -81.8 -75.5 -107.6 -87.6 ... and I want to calculate the correlation between those. Is there a graphical way in R to plot the correlations or not? I would like to thank you in advance for

[R] R - How to physically Increase Speed

2013-10-21 Thread Alexandre Khelifa
Hi, My name is Alexandre Khelifa and I have been using R at my work for about 2 years. I have been working on a project when we do Monte Carlo Simulation and it involves a lot of calculations. I am currently using R x64.3.0.1 and used to work on a 4GB machine. However, the calculation time was

[R] Quick advice on loading packages

2013-10-21 Thread Data Analytics Corp.
Hi, I need some quick advice/help on loading packages. I want to write a simple function to load a number of packages I intend to use at a conference presentation. I'm thinking of something like: fn.install - function(){install.packages(c(ggplot2, scales), repos = c:\\temp)}

Re: [R] R - How to physically Increase Speed

2013-10-21 Thread Henrik Bengtsson
On Mon, Oct 21, 2013 at 4:12 PM, Alexandre Khelifa akhel...@logitech.com wrote: Hi, My name is Alexandre Khelifa and I have been using R at my work for about 2 years. I have been working on a project when we do Monte Carlo Simulation and it involves a lot of calculations. I am currently