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

2013-10-20 Thread David Degras
Hi All, After successfully setting up the Accelerate BLAS library via /cd /Library/Frameworks/R.framework/Resources/lib ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib libRblas.dylib / I restarted R (version 3.0.1) and got the

Re: [R] Data Manipulation in R

2013-10-20 Thread arun
Hi, May be this helps: Y1 <- read.table(text="V1 V2 V3 V4 1 4 0 20 17 2 4 0 15 17 3 2 0 13 21",sep="",header=TRUE) Y2 <- read.table(text="V1 V2 V3 V4 1 20 52 15 18 2 18 54 14 21 3 18 51 13 21",sep="",header=TRUE)  res <- lapply(seq_len(nrow(Y1)),function(i) {dat <- data.frame(X=i,Y1=unlist(Y1[i,]

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

2013-10-20 Thread Mark Leeds
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. Again, I didn't look at the details but one way to deal with this is to have the likelihood f

[R] Data Manipulation in R

2013-10-20 Thread Anamika Chaudhuri
Hi: I am looking for some help to manipulate data in R. I have two csv files. datasetY1 V1 "V2" "V3" "V4" 1 4 0 20 17 2 4 0 15 17 3 2 0 13 21 datasetY2 V1 "V2" "V3" "V4" 1 20 52 15 18 2 18 54 14 21 3 18 51 13 21 I want to be able to create separate csv files by taking the corresponding

Re: [R] Loop for taking sum of rows based on proximity to other non-NA rows

2013-10-20 Thread arun
Sorry, I noticed that when two "Count" values are the same and NA in between, my function fails. #Modified fun1 <- function(dat,n) {  rl <- rle(is.na(dat[,"Count"])) indx <- which(is.na(dat[,"Count"]))[rep(rl$lengths[rl$values],rl$lengths[rl$values])==n]  lst1 <- lapply(split(indx,((seq_along(in

Re: [R] XML package not working

2013-10-20 Thread CEO'Riley
I'm running the same os system and same r version. Only difference I see in Sys.info() is that login, user, and effective_user on my machine is all are of the same case. Your display shows login as upper case. I'm not even sure if that would make a difference. With gratitude, CEO'Riley Jr. Ch

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

2013-10-20 Thread William Dunlap
Do you mean that your objective function (given to nlminb) parameterized a positive definite matrix, P, as the elements in its upper (or lower) triangle? If so, you could reparameterize it by the non-zero (upper triangular) elements of the Choleski decomposition, C, of P. Compute P as crossprod(C)

Re: [R] Loop for taking sum of rows based on proximity to other non-NA rows

2013-10-20 Thread arun
Hi Jeff, I found some difference in results between your function and mine.  It also point out a mistake in my code. In the original post, it says: """ I need to write a loop to march down the rows, and if there are 2 rows in "Count" where there is only 1 NA row between them, sum the

Re: [R] XML package not working

2013-10-20 Thread Steven Dwayne Randolph
My apologies for not conforming to the posting guideline. Sys.info() sysname release version "Windows" "7 x64" "build 7601, Service Pack 1" nodename

[R] "Error : requires numeric/complex matrix/vector arguments‏"

2013-10-20 Thread valentina colombo
Can you post my message?ThanksValentina Dear R users, I hope that this format is find. I'm a new user of R. I'm trying to do a LM test as in Terasvirta (2013) and when I run the code there is this type of error: Error in t(mX) %*% mX : requires numer

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

2013-10-20 Thread David Winsemius
On Oct 20, 2013, at 3:01 PM, Steven LeBlanc wrote: > Greets, > > I'm trying to use nlminb() to estimate the parameters of a bivariate normal > sample and during one of the iterations it passes a parameter vector to the > likelihood function resulting in an invalid covariance matrix that causes

Re: [R] Loop for taking sum of rows based on proximity to other non-NA rows

2013-10-20 Thread Jeff Newmiller
Looks like a right parenthesis was dropped. Corrected: removeNNAs <- function( dat, N, lessOrEqual=FALSE ) { N1 <- N+1 rx <- rle( !is.na( dat$Count ) ) # indexes of the ends of each run of NAs or non-NAs cs <- cumsum( rx$lengths ) # indexes of the ends of runs of NAs or non-NAs cs2 <-

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

2013-10-20 Thread Steven LeBlanc
Greets, I'm trying to use nlminb() to estimate the parameters of a bivariate normal sample and during one of the iterations it passes a parameter vector to the likelihood function resulting in an invalid covariance matrix that causes dmvnorm() to throw an error. Thus, it seems I need to somehow

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

2013-10-20 Thread eliza botto
Dear Arun,Thankyou very much. Glad that you helped.:Deliza > Date: Sat, 19 Oct 2013 21:31:09 -0700 > From: smartpink...@yahoo.com > Subject: Re: [R] bold dot size and name in plot > To: r-help@r-project.org > CC: eliza_bo...@hotmail.com; j...@bitwrit.com.au > > Hi, > May be this also helps. Usin

Re: [R] Loop for taking sum of rows based on proximity to other non-NA rows

2013-10-20 Thread Jeff Newmiller
I thought this question looked interesting enough to make my own stab at it, but in hindsight I think this business of combining the counts seems quite unlikely to be necessary... it would be simpler and less damaging to the original data pattern to just remove groups of rows having fewer than

Re: [R] MaxLik estimation issues

2013-10-20 Thread Arne Henningsen
Dear Filipe On 14 October 2013 17:42, Filipe Ribeiro wrote: > Dear Arne, > > First of all, thank you very much for your reply. Secondly, please accept my > apologies for only give you an answer now, but I was moving from one country > to another and only today I was able to get back to work. > I

Re: [R] loop not working my way

2013-10-20 Thread Rui Barradas
Hello, Make a _simple_ example, I don't see what packages like knitr or ggplot2 have anything to do with your problem. Like this is, I think you're asking too much from r-help. Rui Barradas Em 19-10-2013 23:38, Laz escreveu: Dear R users, Dear R users, (I had not included two more function

Re: [R] Combining two models into one

2013-10-20 Thread Carl Witthoft
You created a bunch of 'x' items but call for "X" in your formula. That's part of it. Next, you don't provide a "data=x" argument in your lm() call, so it goes off and looks for various capital-X items (I suspect). Hint: start with a small, simple dataset and work with it until you know how t

Re: [R] XML package not working

2013-10-20 Thread Duncan Murdoch
On 13-10-20 9:23 AM, Steven Dwayne Randolph wrote: My apologies for not conforming to the posting guideline. Sys.info() sysname release version "Windows" "7 x64" "build 7601, Service Pack

Re: [R] saveXML() prefix argument

2013-10-20 Thread Duncan Temple Lang
Thanks Earl and Milan. Yes, the C code to serialize does branch and do things differently for the different combinations of file, encoding and indent. I have updated the code to use a different routine in libxml2 for this case and that honors the indentation in this case. That will be in the next

Re: [R] Nash-Sutcliffe coefficient

2013-10-20 Thread Berend Hasselman
On 20-10-2013, at 17:29, Ahmed Attia wrote: > Hi > > Could you please inform how can I get the Nash-Sutcliffe coefficient in r? > > Comparing observed vs. simulated values. > > Appreciated > Install package sos. Then findFn("Nash") should lead you to package hydroGOF which seems to have se

[R] Nash-Sutcliffe coefficient

2013-10-20 Thread Ahmed Attia
Hi Could you please inform how can I get the Nash-Sutcliffe coefficient in r? Comparing observed vs. simulated values. Appreciated -- Ahmed M. Attia Research Assistant Dept. Of Soil&Crop Sciences Texas A&M University ahmed.at...@ag.tamu.edu Cell phone: 001-979-248-5215 _

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

2013-10-20 Thread Berend Hasselman
On 20-10-2013, at 16:16, valentina colombo wrote: > Dear Mr. Hasselman, > I have attached my code to solve (hopefully) my problem in Error-require > numeric/complex matrix/vector > Any suggestions? > Thanks > Please answer to the list and NOT only privately. I'm forwarding this message to R-h

Re: [R] Want to create a histogram

2013-10-20 Thread John Kane
I don't think you do. I think that you are confusing a histogram and a bar chart. With only five data points and five categories you have data for a barplot. I see Jim has provided one approach Another, using the ggplot2 package (which you will probably have to install is : # to install gg

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

2013-10-20 Thread Berend Hasselman
On 20-10-2013, at 13:08, valentina colombo wrote: > Dear R users,I'm a new user of R. I'm trying to do a LM test an there is this > type of error: Error in t(mX) %*% mX : requires numeric/complex matrix/vector > arguments. > To be clear I write down the code in which mY ( 126,1 ) mX (126,1)

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

2013-10-20 Thread John Kane
It looks like you have posted in HTML and your code is basically unreadable. Please repost in text format. Also I'd suggest reading one or both of the following lists for some hints on how to create a good question. I think a key point here is to supply sample data using the dput() function a

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

2013-10-20 Thread valentina colombo
Dear R users,I'm a new user of R. I'm trying to do a LM test an there is this type of error: Error in t(mX) %*% mX : requires numeric/complex matrix/vector arguments. To be clear I write down the code in which mY ( 126,1 ) mX (126,1) mZ(126,1) are matrix. LMTEST <- function(mY, mX, mZ)#mY,

[R] R2admb compile problem

2013-10-20 Thread Allan Clark
Good morning all I am trying to use R2admb and have the following very simple example. The *.tpl is included below. I am a Windows 7 user, using R3.01. //Function1.tpl //* PARAMETER_SECTION init_number x; objective_function_value C; PROCEDURE_SECTION C= pow(x

[R] Combining two models into one

2013-10-20 Thread luana
Hi guys, I'm trying to combining 2 models into 1 but maybe I'm not doing this in the right way. my dataset is about the level of the vitamin A in the blood measured at different times with two different treatments (ie. I have 6 coloums, vit A1 , time1, treat1, vit A2, time2, treat2, n=28). It wants

Re: [R] No P.values in polr summary

2013-10-20 Thread Achim Zeileis
On Sat, 19 Oct 2013, Tal Galili wrote: Vincent, I believe Prof. Ripley is referring to this: http://www.stats.ox.ac.uk/pub/MASS4/ Contact Details:--- Contact me: tal.gal...@gmail.com | Read me: www.talgalili.com (Hebrew) | www.