Re: [R] (performance) time in Windows vs Linux

2009-06-28 Thread milton ruser
Really? In fact I have a quadcore. But how can I know if Linux are really using only one core, and how can I setup it to use the 4cores? Thanks a lot, milton On Mon, Jun 29, 2009 at 1:46 AM, Patrick Connolly < p_conno...@slingshot.co.nz> wrote: > On Fri, 26-Jun-2009 at 04:37PM -0400, milton ru

[R] R CMD build for windows package from linux

2009-06-28 Thread Jorge Cornejo
Hi, exist any way to create a windows installable package from a Linux R installation ?? I try R CMD build --binary --use-zip MyPack But generate a tar.gz file. Thanks in advance __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] (performance) time in Windows vs Linux

2009-06-28 Thread Patrick Connolly
On Fri, 26-Jun-2009 at 04:37PM -0400, milton ruser wrote: |> Hi there, |> |> I have both systems on a DELL 64bit machine. |> I compiled R 2.9.0 on both systems, to get 64bits capability. |> Surpriselly, on Linux (Ubuntu with I installed 3 month ago) I spent |> 41s to run the same test you did,

Re: [R] newbie - read.csv creates a (data.frame, table, array, matrix, ...) and plotting one column

2009-06-28 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Mark Knecht > Sent: Sunday, June 28, 2009 7:32 PM > To: Gabor Grothendieck > Cc: r-help@r-project.org > Subject: Re: [R] newbie - read.csv creates a (data.frame, > table, array,

[R] Saving RGL Graphs

2009-06-28 Thread Patrick Gedeon
Dear Users: I have created several 3d scatter plots using the rgl package. I wish to save each of them so that I can later open them in R and view/rotate them. What is the command to do this? Also, do I need to save them each into individual files, or can I save them all together and then somehow

Re: [R] GARCH:: False Convergence

2009-06-28 Thread spencerg
I have not seen a reply to this post, so I will offer a couple of comments: To look for other garch capabilities in R, I tried the following: library(RSiteSearch) gch <- RSiteSearch.function('garch') summary(gch) HTML(gch) This found 111 help pages in 18 packages containi

[R] comma-separated thousands in numbers on plot axes?

2009-06-28 Thread Alexy Khrabrov
How can I make R separate thousands, millions, etc., on the plot axes, with commas? Cheers, Alexy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.h

[R] HLM - centering level 2 predictor

2009-06-28 Thread Ito, Sachiyo
Dear R-helpers, I'm analyzing a data with hierarchical linear model. I have one level 1 predictor and one level 2 predictor, which looks like below: fm1 <- lmer(y ~ 1 + x1 + x2 + x1:x2 + (1 + x1 | id.full)) where: y is the outcome variable. x1 is the level 1 predictor variable. x2 is the level

[R] Meta-Analysis: Metaplot Labels, SE, and Summary

2009-06-28 Thread Ishwar Bridgelal
Hello, I'm ashamed to admit that I'm an R and meta-analysis neophyte just when my colleagues and I are attempting to run R for that latter purpose. We would like to construct a graph of the 95% confidence intervals of odds ratios (inverse odds ratios, actually). We are using the metaplot() function

Re: [R] newbie - read.csv creates a (data.frame, table, array, matrix, ...) and plotting one column

2009-06-28 Thread Mark Knecht
Thank you VERY much Gabor. I learned a LOT from this little post: 1) I can read/modify/write data in the array using the sub function 2) I can address columns using $COLUMN_HEADER 3) I can do an XY plot using X ~ Y Brilliant! Thanks! Small result PDF attached. Cheers, Mark On Sun, Jun 28, 2009

[R] Naive knn question

2009-06-28 Thread Stephanie Januchowski
Dear list, I have two dissimilarity matrices, one for a training data set which I then clustered using PAM. The second is a diss matrix for a validation data set (an independent field sample). I have been trying to use knn to distinguish distances between the validation data set and the 6 mediods

Re: [R] help with hexbin package

2009-06-28 Thread Ben Bolker
RAVI KAPOOR wrote: > > Dear All > > i am trying to figure out the use of hexbin function in the hexbin package > --can any one send me a working example of the same > > The > example(hexbin) ---option is of not much use > > You're probably going to have to provide more information. "This

Re: [R] newbie - read.csv creates a (data.frame, table, array, matrix, ...) and plotting one column

2009-06-28 Thread Gabor Grothendieck
Try removing double quotes and commas from T1$EQUITY and then convert it to numeric: T1$EQUITY <- as.numeric(sub('[",]', '', T1$EQUITY)) plot(EQUITY ~ TRADE, T1) On Sun, Jun 28, 2009 at 9:14 PM, Mark Knecht wrote: > On Sun, Jun 28, 2009 at 4:02 PM, Mark Knecht wrote: >> Hi all, >>   Newbie alert

Re: [R] ggplot2 x axis question

2009-06-28 Thread hadley wickham
Hi Chris, Try this: qplot(reorder(model, delta), delta, data = growthm.bic) Hadley On Sun, Jun 28, 2009 at 9:53 AM, Christopher Desjardins wrote: > Hi, > I have 45 models that I have named: 1, 2, 3, ... , 45 and I am trying to > plot them in order of ascending BIC values. I am however unclear a

Re: [R] newbie - read.csv creates a (data.frame, table, array, matrix, ...) and plotting one column

2009-06-28 Thread Mark Knecht
On Sun, Jun 28, 2009 at 4:02 PM, Mark Knecht wrote: > Hi all, >   Newbie alert. > >   The second question is about plotting one column from data set. > I've used read.csv to read in somethign called PFA_VWAP. row.names, > names and dim all return sensible values. The command > PFA_VWAP_Equity<-PFA

Re: [R] Printing output together

2009-06-28 Thread jim holtman
You have a list as output from 'lapply'. To convert back into a matrix use: do.call(rbind, var21) On Sun, Jun 28, 2009 at 9:01 PM, Shaan Glaz wrote: > Hi! > > I want to print the output all together with a single column name > > s21<-c(1:1000); > var21<-lapply(s21,function(x){ >ns<-rnorm

[R] Printing output together

2009-06-28 Thread Shaan Glaz
Hi!   I want to print the output all together with a single column name   s21<-c(1:1000); var21<-lapply(s21,function(x){    ns<-rnorm(78,8,9);    n<-length(ns);    Mn<-mean(ns)    Sn2<-var(ns)    return(cbind(x,Mn,Sn2)); }); var21 but my code is giving me somewhat like the following [[1]] x   Mn

[R] Export rgl plot3d scatter

2009-06-28 Thread Patrick Gedeon
Hello, I have created a 3d scatter plot using plot3d. Is it possible to export the resulting graph so that it can be placed in a pdf, powerpoint, or something of the sort and still be able to rotate it? Thanks [[alternative HTML version deleted]] _

Re: [R] HLM - centering level 2 predictor

2009-06-28 Thread Daniel Malter
without being an expert for the specific lmer error code, it seems that your model matrix is singular, that is, not full rank. For that reason, X'X is not invertible, which means that there is no unique solution to the problem. Have you tried with x2 alone, without the interaction effect between x1

Re: [R] Same initial seed

2009-06-28 Thread diegol
Great. Your suggestion is most welcome, everything is clear now. Thank you for your time, Duncan! Regards, Diego Duncan Murdoch-2 wrote: > > diegol wrote: >> Hello, >> >> I have tried a few searches without luck before posting, since this one >> seems a pretty basic question. >> I am using

[R] newbie - read.csv creates a (data.frame, table, array, matrix, ...) and plotting one column

2009-06-28 Thread Mark Knecht
Hi all, Newbie alert. OK, I'm reading the help file using Ted's suggestion of ?read.csv or ?read.table, etc., and trying to understand exactly what R has created for me when I do the read.csv command. The overall header says read.table creates a 'data.frame', which is fine with me as it works, b

Re: [R] Same initial seed

2009-06-28 Thread Duncan Murdoch
diegol wrote: Hello, I have tried a few searches without luck before posting, since this one seems a pretty basic question. I am using R 2.7.0 on WinXP, as I have long started using this version for my thesis work and am reluctant to update fearing consistency/backward compatibility issues cou

Re: [R] Same initial seed

2009-06-28 Thread diegol
Update: I had tried, immediately after launching the console: > rm(list=ls()) which did not seem to affect .Random.seed. But now I try: > rm(.Random.seed) which seems to force .Random.seed to regenerate from current time. Can I feel confident to have solved the problem? Thanks! diegol wr

Re: [R] panel.text and saving to pdf

2009-06-28 Thread willem vervoort
Hi all, IN the end the page() function was what I wanted. I was using levelplot in the actual code and I wanted different text in each of the panels. That was only possible with the paeg function or with trellis.focus() Thanks for the tips Willem On Sat, Jun 27, 2009 at 3:14 AM, Deepayan Sarkar w

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Mark Knecht
On Sun, Jun 28, 2009 at 2:38 PM, Ted Harding wrote: > More explicitly, it could be written: > >    skip: integer: the number of lines of the data file to skip before >          beginning to read the lines in the file. > > Hoping this helps! > Ted. It does! More questions coming once I do some mor

[R] Same initial seed

2009-06-28 Thread diegol
Hello, I have tried a few searches without luck before posting, since this one seems a pretty basic question. I am using R 2.7.0 on WinXP, as I have long started using this version for my thesis work and am reluctant to update fearing consistency/backward compatibility issues could happen. I no

Re: [R] ERROR: system is computationally singular: reciprocal condition number = 4.90109e-18

2009-06-28 Thread Ravi Varadhan
Hi, You are being rude to those who are trying to help you by ignoring their suggestions and by sending useless, irrelevant information. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Geron

[R] HLM - centering level 2 predictor

2009-06-28 Thread Sachi Ito
Dear R-helpers, I'm analyzing a data with hierarchical linear model. I have one level 1 predictor and one level 2 predictor, which looks like below: fm1 <- lmer(y ~ 1 + x1 + x2 + x1:x2 + (1 + x1 | id.full)) where: y is the outcome variable. x1 is the level 1 predictor variable. x2 is the level

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Ted Harding
On 28-Jun-09 21:05:59, Mark Knecht wrote: > Hi, > Complete newbie to R here. Just getting started reading manuals and > playing with data. > > I've managed to successfully get my *.csv files into R, however I > have to use header=FALSE because the real header starts in line #2. > The file format l

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Mark Knecht
On Sun, Jun 28, 2009 at 2:18 PM, Peter Dalgaard wrote: > Mark Knecht wrote: >> >> Hi, >>   Complete newbie to R here. Just getting started reading manuals and >> playing with data. >> >>   I've managed to successfully get my *.csv files into R, however I >> have to use header=FALSE because the real

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Joshua Wiley
Hey Mark, What about something like read.csv(file="yourfile", skip=1, header=TRUE) Hope that helps, Joshua On Sun, Jun 28, 2009 at 2:05 PM, Mark Knecht wrote: > Hi, >   Complete newbie to R here. Just getting started reading manuals and > playing with data. > >   I've managed to successfully g

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Peter Dalgaard
Mark Knecht wrote: Hi, Complete newbie to R here. Just getting started reading manuals and playing with data. I've managed to successfully get my *.csv files into R, however I have to use header=FALSE because the real header starts in line #2. The file format looks like: PORTFOLIO EQUITY

[R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Mark Knecht
Hi, Complete newbie to R here. Just getting started reading manuals and playing with data. I've managed to successfully get my *.csv files into R, however I have to use header=FALSE because the real header starts in line #2. The file format looks like: PORTFOLIO EQUITY TABLE TRADE,MARK-SYS

Re: [R] Automatically placing a legend in an area with the most white space...

2009-06-28 Thread Stavros Macrakis
install.packages('plotrix') On Sun, Jun 28, 2009 at 3:51 PM, Jason Rupert wrote: > ... > Error in legend(emptyspace(rep(x_vals_1, 3), c(y1_vals, y2_vals, y3_vals)), > : > could not find function "emptyspace" > > I've searched via RSeek, but I have not been able to find anything on this > functi

Re: [R] Automatically placing a legend in an area with the most white space...

2009-06-28 Thread Jason Rupert
Jim, Thank you very much for your feedback. It is very much appreciated to know this is possible. I tried to reproduce your post, but I ran into a problem: > legend(emptyspace(rep(x_vals_1,3),c(y1_vals,y2_vals,y3_vals)), c("Best Guess > 1" , "Best Guess 2", "Best Guess 3"), xjust=0.5, yju

Re: [R] testing an ARFIMA model for structural breaks with unknown breakpoint

2009-06-28 Thread Achim Zeileis
On Sun, 28 Jun 2009, mihaela wrote: Thanks for your reply. Is there other package which could help me in this regard? Or simply I can't do this in R? AFAIK, there is currently no package which implements the necessary limiting distributions. Regarding "ts" object, I try: s<-read.csv("C:/d

Re: [R] Compute correlation matrix for panel data with, specific ordering

2009-06-28 Thread Serguei Kaniovski
Ok I see how to sort the factors, but how do I compute the correlation matrix in a repeated observations dataset (see the first part of my question) Thanks again for your help! Serge __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] simple loop

2009-06-28 Thread hadley wickham
> Also consider ddply in the plyr package (although that's an over kill if > your only having two loops) Maybe, but it sure is much simpler: library(plyr) ddply(data, c("industry","year"), summarise, avg = mean(X1)) Hadley -- http://had.co.nz/ __ R-

[R] Fold function with several time varying covariates

2009-06-28 Thread Jenkins, Helen
Hi I'm trying to use the fold function as described here: http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf Page9 It does say that you can use this when you have more than one time varying covariate: in the description of the argument cov it says: "cov: A vector gi

Re: [R] simple loop

2009-06-28 Thread Tal Galili
Hi Cecilia, Trying it your way there where three reasons for errors, I fixed them in the following code: means<-matrix(nrow=3,ncol=4) counter.i <- 0 counter.j <- 0 for (i in levels(factor(data$industry))) { counter.i <- counter.i + 1 for (j in levels(factor(data$year))) { counter.j <- counter

Re: [R] simple loop

2009-06-28 Thread Jorge Ivan Velez
Dear Cecilia, Here is one way: with(, tapply(X1, list(year, industry), mean)) Also, take a look at ?ave and its examples. HTH, Jorge On Sun, Jun 28, 2009 at 12:39 PM, Cecilia Carmo wrote: > Hi everyone! > > I have this dataframe: > > firm<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4),rep(5,4),rep

Re: [R] code that will use two data sets which differ in size.

2009-06-28 Thread John Kane
If I understand what you want, you simply want to calculate some means in one data.frame and put some of them in another data.frame? Data.frames are of unequal lenght but you know the indices for each. As long as you know the indices the relative sizes should be irrelevant. Try something like t

[R] simple loop

2009-06-28 Thread Cecilia Carmo
Hi everyone! I have this dataframe: firm<-c(rep(1,4),rep(2,4),rep(3,4),rep(4,4),rep(5,4),rep(6,4)) year<-c(rep(2000:2003,6)) industry<-c(rep(10,4),rep(20,4),rep(30,4),rep(10,4),rep(20,4),rep(30,4)) X1<-c(10,14,18,16,20,45,23,54,24,67,98,58,16,32,57,12,54,0,0,22,11,3,5,6) data<-data.frame(firm, i

[R] Sweave findings

2009-06-28 Thread Frank E Harrell Jr
Dear Group: After struggling with escape sequences using the LaTeX listings package (used by the R SweaveListingUtils package), I have come to the conclusing that listings' interaction with the LaTeX fancyvrb package prevents escapes such as plot(x) # See Figure \ref{my.plot} The only wa

Re: [R] Heteroskedasticity and Autocorrelation in SemiPar package

2009-06-28 Thread Achim Zeileis
On Fri, 26 Jun 2009, Liviu Andronic wrote: On Fri, Jun 26, 2009 at 10:11 PM, Susan Chen wrote: Does anyone know how to report heteroskedasticity and autocorrelation-consistent standard errors when using the "spm" command in SemiPar package? Suppose the original command is sp1<-spm(y~x1+x2+f(x

Re: [R] testing an ARFIMA model for structural breaks with unknown breakpoint

2009-06-28 Thread mihaela
Thanks for your reply. Is there other package which could help me in this regard? Or simply I can't do this in R? Regarding "ts" object, I try: s<-read.csv("C:/data.csv",header=TRUE) x<-ts(s) fs.x <- Fstats(x ~1) and I get the following error: > fs.x <- Fstats(x ~1) Error in as.matrix(X[((poin

[R] ERROR: system is computationally singular: reciprocal condition number = 4.90109e-18

2009-06-28 Thread Moumita Das
Hi All, This is my R-version information:--- > version _ platform i486-pc-linux-gnu arch i486 os linux-gnu system i486, linux-gnu status major 2 minor 7.1 year 2008 month 06 day23 svn rev4597

[R] ggplot2 x axis question

2009-06-28 Thread Christopher Desjardins
Hi, I have 45 models that I have named: 1, 2, 3, ... , 45 and I am trying to plot them in order of ascending BIC values. I am however unclear as to how I can get the models to line up on the x-axis by BIC and not by numeric order. For example, if model 5 has a lower BIC than 1, I want it to be

Re: [R] Error: system is computationally singular: reciprocal condition number

2009-06-28 Thread Ravi Varadhan
It is a basic linear algebra issue and has nothing to do with statistics I told you what your problem is and also how to solve it. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontolog

Re: [R] testing an ARFIMA model for structural breaks with unknown breakpoint

2009-06-28 Thread Achim Zeileis
On Sun, 28 Jun 2009, mihaela wrote: Dear R users, I'm trying to use the "strucchange" package to determine structural breaks in an ARFIMA model. ARFIMA models are not supported in "strucchange" at the moment. They typically require a different asymptotic theory due to the fractional integr

Re: [R] Error: system is computationally singular: reciprocal condition number

2009-06-28 Thread Moumita Das
I get this error on using the, traceback() function :-- > traceback() 10: .Call("La_dgesv", a, b, tol, PACKAGE = "base") 9: solve.default(Szz) 8: solve(Szz) 7: pcor.mat(firstvalue, secondvalue, third_var, method, na.rm = T) 6: PartialCorr_Calculation(value1, value2, third_var, method = "pearso

[R] testing an ARFIMA model for structural breaks with unknown breakpoint

2009-06-28 Thread mihaela
Dear R users, I'm trying to use the "strucchange" package to determine structural breaks in an ARFIMA model. Unfortunately I'm not so familiar with this topic (and worse, I'm a beginner in R), so I don't know exactly how to specify my model so that the "Fstats","sctest" and "breakpoint" function

Re: [R] how to interpret coefficients for a natural spline smooth function in a GLM

2009-06-28 Thread Frank E Harrell Jr
spencerg wrote: I have not seen a reply to this question, so I will offer a comment; someone who knows more than I may correct or add to my comments. There are many different kinds of splines. Perhaps the most common are B-splines, which sum to 1 inside their range of definition an

Re: [R] transforming character categories

2009-06-28 Thread Gabor Grothendieck
Or use the labels= argument of factor. On Sun, Jun 28, 2009 at 8:06 AM, Peter Dalgaard wrote: > Gabor Grothendieck wrote: >> >> If you only want to convert them to unique numbers then >> >> as.numeric(factor(x)) >> >> will do that. > > Or, use it directly for indexing, as in c(1000,2500,4173,3700)

Re: [R] transforming character categories

2009-06-28 Thread Peter Dalgaard
Gabor Grothendieck wrote: If you only want to convert them to unique numbers then as.numeric(factor(x)) will do that. Or, use it directly for indexing, as in c(1000,2500,4173,3700)[factor(x)] DEPENDING on LEVEL ORDER, mind you! So make sure you know what the order is or set it yourself usin

[R] A new R-community in Orkut

2009-06-28 Thread Moumita Das
Hi friends, I just created a new R- community in Orkut.Please do join.And we can stay connected. Name of the community: Statistics & R-language -- Thanks Moumita [[alternative HTML version deleted]]

Re: [R] transforming character categories

2009-06-28 Thread Gabor Grothendieck
If you only want to convert them to unique numbers then as.numeric(factor(x)) will do that. On Sun, Jun 28, 2009 at 7:00 AM, Gregor Povh wrote: > Thanks Gabor, but in my case not every value ist actually encoded within > the character string.  Vor example, I have an answer category, which is > "

Re: [R] transforming character categories

2009-06-28 Thread Gregor Povh
Thanks Gabor, but in my case not every value ist actually encoded within the character string. Vor example, I have an answer category, which is "more than one Mio. $". (not in the column "income"...). I have the feeling, that there must be an another, straightforward way or function for tran

Re: [R] Defining class as a member of another class

2009-06-28 Thread Wacek Kusnierczyk
Peter Dalgaard wrote: Wacek Kusnierczyk wrote: Martin Morgan wrote: Gabor Grothendieck wrote: Try this: setClass("zoo") [1] "zoo" 'zoo' is I guess intended as an S3 class (from library zoo), so setOldClass('zoo') is appropriate. Otherwise, setClass("zoo") creates a new vi

Re: [R] transforming character categories

2009-06-28 Thread Gabor Grothendieck
Try this. It matches the first numeric string on each line applying as.numeric to it and then using c to simplify the resulting list to a numeric vector. > x <- c("from 1000$ to 2000$", "from 2000$ to 3000$", "more than 3000$", + "from 1000$ to 2000$", "from 1000$ to 2000$") > library(gsubfn) >

Re: [R] Automatically placing a legend in an area with the most white space...

2009-06-28 Thread Jim Lemon
Jason Rupert wrote: At one point I believe I heard of an R package that would automatically find the most empty space in a plot, and then that answer could then be used to intelligently place a legend. I would like to try to apply that R package to the contrived example shown below, so thank yo

Re: [R] Defining class as a member of another class

2009-06-28 Thread Peter Dalgaard
Wacek Kusnierczyk wrote: Martin Morgan wrote: Gabor Grothendieck wrote: Try this: setClass("zoo") [1] "zoo" 'zoo' is I guess intended as an S3 class (from library zoo), so setOldClass('zoo') is appropriate. Otherwise, setClass("zoo") creates a new virtual class. setCl

Re: [R] code that will use two data sets which differ in size.

2009-06-28 Thread arnoldo
Hi , Thanks for the timely reply in,z is the larger dataframe and m is the shorter dataframe. The code took more than 2 hrs and I had to kill it. Another way putting this question could be; how can I use th family of (apply) funtions to get the summary of one of the variables based on two factor

Re: [R] multiple regression w/ no intercept; strange results

2009-06-28 Thread Dieter Menne
I am writing some software to do multiple regression and am using r to benchmark the results. The results are squaring up nicely for the "with-intercept" case but not for the "no-intercept" case. I am not sure what R is doing to get the statistics for the 0 intercept case. ... It seems odd to

[R] transforming character categories

2009-06-28 Thread Gregor Povh
Dear R users, apologies for this quite simple question. I've tried serverall approaches, however, could not generate the desired result. I have a large data frame, which has several cathegories encoded as character strings, for example. Name, income, gender, ... ... "from 1000$ to 2000$

[R] help with hexbin package

2009-06-28 Thread RAVI KAPOOR
Dear All i am trying to figure out the use of hexbin function in the hexbin package --can any one send me a working example of the same The > example(hexbin) ---option is of not much use Thanks Kind regards Ravi [[alternative HTML version deleted]] ___