[R] Manage huge database

2008-09-21 Thread José E. Lozano
Hello, Recently I have been trying to open a huge database with no success. It’s a 4GB csv plain text file with around 2000 rows and over 500,000 columns/variables. I have try with The SAS System, but it reads only around 5000 columns, no more. R hangs up when opening. Is there any

Re: [R] Variable Selection for data reduction and discriminant anlaysis

2008-09-21 Thread Mark Difford
Hi Gareth, >> My data is transformed to the clr or alr under Aitchison geometry, so I >> am essentially working >> in Euclidean space. Great: glad to hear it. >> Has anyone had experience doing stepwise LDA?? I can't for the life of >> me find any help >> online about where to start. A bett

[R] Matrix balancing on margins

2008-09-21 Thread PALMIER Patrick - CETE NP/INFRA/TRF
Hello, Is there any package in R for balancing matrix I want to estimate a matrix with * a initial matrix (1 everywhere for example) * Row margin * Col margin * distance class vector (each cell of the matrix belong to a distance class) and I want that the distance class

[R] Time series (ts) questions.

2008-09-21 Thread rkevinburton
I have been working with the base time series object (ts) and I had a couple of questions that hopefully this group can help me with: 1) What is the best why to append an observation to an existing time-series? Suppose I have a time series: t <- ts(1:12, frequency=5) This would generate two co

Re: [R] adding layers in ggplot2 (data and code included)

2008-09-21 Thread Eric
The way you've attempted to get this result seems to align with the way R "should" work, but it fails in this case. The fix is to break things up a little bit: p <- ggplot(mydata, aes(x=Est, y=Tri)) p <- p + geom_point(aes(colour=factor(Group),shape=factor(Group))) p <- p + geom_smooth(aes(gr

Re: [R] Why isn't R recognising integers as numbers?

2008-09-21 Thread Peter Dalgaard
Ted Byers wrote: Thanks Jim, Alas, it wasn't this. Here is the output from both of your suggestions: refdata18 = read.csv("K:\\MerchantData\\RiskModel\\Capture.Week.18.csv", header = TRUE,na.strings="") str(refdata18) 'data.frame': 341 obs. of 1 variable: $ X0: int 0 0 0 0 0 0 0

[R] Warnings in fitdistr() from MASS.

2008-09-21 Thread Rolf Turner
For a lark, I experimented a bit with the data from Ted Byers' recent postings. The result of fitdistr() seemed sensible, but I was bothered by the warnings about NaNs that arose. Warnings always make me nervous. Explicitly this is what I did: TXT <- "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

[R] adding layers in ggplot2 (data and code included)

2008-09-21 Thread Juliet Hannah
Here is some sample data: mydata <- read.table(textConnection("Est GroupTri 00 4.639644 10 4.579189 20 4.590714 01 4.443696 11 4.588243 21 4.650505 02 4.296608 12 4.826036

[R] Hmisc and Ubuntu (aptitude install)

2008-09-21 Thread Matthew Pettis
Hi, I'm trying to get the Hmisc module on my Ubuntu Hardy Heron install. I tried getting Hmisc from within R by issuing the standard 'install.packages' command, but it said I needed 'gfortran' to compile. I thought I could circumvent this by using 'aptitude' to get the package 'r-cran-hmisc', but

[R] Help for R

2008-09-21 Thread Mac
Dear R users£¬ I've just started learning R and I'm having a problem with it. I was told as following when I tried to run R: Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) : in 'matlab' methods specified for export, but none defined: su

Re: [R] PDF fonts problem

2008-09-21 Thread Paul Murrell
Hi Mihalicza Péter wrote: > Dear Dr. Murrel, > > Thank you for all the clarifications! > > Paul Murrell írta: >> Hi >> >>> >>> #CMS >>> pdf("tryfont-cms.pdf", family="CMS") >>> grid.text("gg\u151hh\uF6ii\uF3jj kk\u171ll\uFCmm\uFAnn") >>> dev.off() >>> #u151 and u171 doesn't show, though the oth

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread Bingshan Li
Hi Gabor, This works. This is exactly what I want. According to John Fox's reply, I used expression(NA>=1) and it also worked. Thanks for the kind and clever help. Bingshan Gabor Grothendieck wrote: On Sun, Sep 21, 2008 at 11:23 AM, Li, Bingshan <[EMAIL PROTECTED]> wrote: Hi John, Yes

Re: [R] Calculating interval for conditional/unconditional correlation matrix

2008-09-21 Thread Moshe Olshansky
Hi Ana, There are two problems: First of all, if you want your matrix to have 4 columns it's number of elements should not be 17! Secondly, and this is what causes your error message, you should not call your second function matrix. Call it matrix1, my_matrix, whatever. Otherwise R thinks tha

Re: [R] Why isn't R recognising integers as numbers?

2008-09-21 Thread Marc Schwartz
on 09/21/2008 09:09 PM Ted Byers wrote: > Thanks Marc, > > That was it. > > For the last 30 years, I'd write my own code, in FORTRAN, C++, or even Java, > to do whatever statistical analysis I needed. When at the office, sometimes > I could use SAS, but that hasn't been an option for me in year

Re: [R] Why isn't R recognising integers as numbers?

2008-09-21 Thread Ted Byers
Thanks Marc, That was it. For the last 30 years, I'd write my own code, in FORTRAN, C++, or even Java, to do whatever statistical analysis I needed. When at the office, sometimes I could use SAS, but that hasn't been an option for me in years. This is the first time I have had to load real da

Re: [R] Why isn't R recognising integers as numbers?

2008-09-21 Thread Ted Byers
Thanks Jim, Alas, it wasn't this. Here is the output from both of your suggestions: > refdata18 = read.csv("K:\\MerchantData\\RiskModel\\Capture.Week.18.csv", > header = TRUE,na.strings="") > str(refdata18) 'data.frame': 341 obs. of 1 variable: $ X0: int 0 0 0 0 0 0 0 0 0 0 ... > scan("K:\

Re: [R] Why isn't R recognising integers as numbers?

2008-09-21 Thread Marc Schwartz
on 09/21/2008 08:01 PM Ted Byers wrote: > I have a number of files containing anywhere from a few dozen to a few > thousand integers, one per record. > > The statement "refdata18 = > read.csv("K:\\MerchantData\\RiskModel\\Capture.Week.18.csv", header = > TRUE,na.strings="")" works fine, and if I t

Re: [R] Multiple plots per window

2008-09-21 Thread Gabor Grothendieck
Here are two ways: one using classic graphics and one much shorter way using lattice. ggplot2 would be a another short way (not shown). Lines <- "1995 1996 1997 1998 153 133 145 111 189 177 200 170 221 241 187 243 215 228 201 178 302 283 292 248 223 255 220 202 20

Re: [R] Why isn't R recognising integers as numbers?

2008-09-21 Thread jim holtman
best guess is that they are not integers. Do 'str' on your object and it probably says they are 'factors'. This is probably due to some of your data being non-numeric. Try using 'colClasses' on read.csv to specify what the column should contain. Also try "scan" after skipping the first record i

[R] Why isn't R recognising integers as numbers?

2008-09-21 Thread Ted Byers
I have a number of files containing anywhere from a few dozen to a few thousand integers, one per record. The statement "refdata18 = read.csv("K:\\MerchantData\\RiskModel\\Capture.Week.18.csv", header = TRUE,na.strings="")" works fine, and if I type refdata18, I get the integers displayed, one va

Re: [R] glmer -- extracting standard errors and other statistics

2008-09-21 Thread Weiss, Bernd
John Poulsen schrieb: Hello, I am using glmer() from lmer(lme4) to run generalized linear mixed models. However, I am having a problem extracting the standard errors for the fixed effects. I have used: summary(model)$coef fixed.effects(model) coef(model) to get out the parameter estimates

Re: [R] Multiple plots per window

2008-09-21 Thread p
sorry, as Mark Leeds pointed out to me, the row/column numbers where mixed up in my example... happens when you cut & paste like mad from your history... it should read as follows: sales2.1 <- c(153,189,221,215,302,223,201,173,121,106,86,87,108, 133,177,241,228,283,255,238,164,128,108,87,74,95, 1

Re: [R] Variable Selection for data reduction and discriminant anlaysis

2008-09-21 Thread gcam032
Thanks Mark, I failed to mention that i'm working within a compositional framework. I didn't want to confuse things. My data is transformed to the clr or alr under Aitchison geometry, so I am essentially working in Euclidean space. Has anyone had experience doing stepwise LDA?? I can't for t

Re: [R] r format questions

2008-09-21 Thread jim holtman
answer to your second question: > paste("$", format(1234567.77, big.mark=','), sep='') [1] "$1,234,568" > you will have to go through each column you want and explicitly do it: > x Region Population Income Illiteracy Life ExpMurder HS GradFrost Area 1 Northeast 549

Re: [R] r format questions

2008-09-21 Thread jim holtman
You have to explicitly ask that they not be printed: > x <- aggregate(state.x77, list(Region = state.region), mean) > x Region Population Income Illiteracy Life ExpMurder HS GradFrost Area 1 Northeast 5495.111 4570.222 1.00 71.26444 4.72 53.96667 132.7778

[R] glmer -- extracting standard errors and other statistics

2008-09-21 Thread John Poulsen
Hello, I am using glmer() from lmer(lme4) to run generalized linear mixed models. However, I am having a problem extracting the standard errors for the fixed effects. I have used: summary(model)$coef fixed.effects(model) coef(model) to get out the parameter estimates, but do not seem able

[R] Multiple plots per window

2008-09-21 Thread p
Hi all, I'm currently working through "The Analysis of Time Series" by Chris Chatfield. In order to also get a better understanding of R, I play around with the examples and Exercises (no homework or assignement, just selfstudy!!). Exercise 2.1 gives the following dataset (sales figures for 4 we

Re: [R] selecting from a series of integers withpre-determined probabilities

2008-09-21 Thread Bert Gunter
?sample. -- Bert Gunter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Sorkin Sent: Saturday, September 20, 2008 12:43 PM To: r-help@r-project.org Subject: [R] selecting from a series of integers withpre-determined probabilities R 2.6 Windows XP I

[R] suppress legend in ggplot(data, aes(y=Y, x=X,fill=Z))?

2008-09-21 Thread Tom Bonen
hi, is there any way to suppress the legend in ggplot(data, aes(y=Y, x=X,fill=Z)) ? i'd like the values to be displayed in different colors as specified by fill= and this works just fine. but i do not want to have the legend on the right that is automactially created when fill is specified. thank

[R] color for lattice box plots

2008-09-21 Thread Tom Bonen
hi, i have a figure with many boxplots and want to differentiate one group of the boxplots by colour of the box. so for example: X <- replicate(3,rnorm(100)) bwplot(X[,1]~as.factor(X[,2]>1)|X[,3]>0) # this gives four boxplots, i'd like to give 1 and 3 a different colour than 2 and 3 # i tried b

[R] design question on piping multiple data sets from 1 file into R

2008-09-21 Thread DS
Hi, I have some queries that I use to get time series information for 8 seperate queries which deal with a different set of time series each. I take my queries run them and save the output as csv file and them format the data into graphs in excel. I wanted to know if there is an elegant

[R] r format questions

2008-09-21 Thread DS
Hi, 1) I have noticed that when I use the aggregate function it outputs numbers in the results. for example: aggregate by product group.1 Aggregate 1ProductA 1000400.00 2ProductB 23232323.00 3Missing 232323.00 is there a way to suppress the numbers infront of ag

Re: [R] Unexpected behaviour when testing for independence with multiple factors

2008-09-21 Thread Javier Acuña
Michael, so you're suggesting that I should do: aux <- interaction( Topology, Drift, lambda) and then fligner.test(dT~aux) Is that correct? On Thu, Sep 18, 2008 at 8:32 AM, Michael Dewey aghmed.fsnet.co.uk> wrote: > At 16:03 17/09/2008, Javier Acuña wrote: >> >> Hi, I'm a new user of R. My back

Re: [R] Unexpected behaviour when testing for independence, with multiple factors

2008-09-21 Thread Javier Acuña
>Ben Bolker ufl.edu> writes: > >I would try > >fligner.test(dT ~ Topology:Drift:lambda) > >in response to: > >Javier Acuna gmail.com> writes: > > Hi, I'm a new user of R. My background is Electrical Engineering, so > please bear with me if this is a silly question. > > I'm trying to assess wheth

Re: [R] fitting a hyperbole

2008-09-21 Thread Rolf Turner
On 21/09/2008, at 10:38 AM, Peter Dalgaard wrote: stephen sefick wrote: I am not sure if I am exaggerating or not read title as hyperbola On Sat, Sep 20, 2008 at 2:20 PM, stephen sefick <[EMAIL PROTECTED]> wrote: I have got a data set that is Gross Primary Productivity ~ Total Suspended

Re: [R] removing a word, the following space and the next word

2008-09-21 Thread Rolf Turner
On 21/09/2008, at 5:15 AM, jim holtman wrote: x <- 'Mr Jones ate lunch and Mr Smith was tied' gsub('(Mr\\.*)\\s+\\w+', "\\1 ", x) [1] "Mr ate lunch and Mr was tied" I don't get what the bit is about. If I do (just) gsub('(Mr\\.*)\\s+\\w+', "\\1 ", x)

Re: [R] Symmetric matrix

2008-09-21 Thread Peter Dalgaard
Jorge Ivan Velez wrote: Dear Megh, Try this: a = matrix(rnorm(36), 6) a[upper.tri(a)]<-a[lower.tri(a)] a HTH, If you look carefully, you'll see that it doesn't work! Dimitris had the better idea. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept.

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread Li, Bingshan
Hi John, It works perfectly. Thank you so much for the help! Have a great day. Bingshan -Original Message- From: John Fox [mailto:[EMAIL PROTECTED] Sent: Sun 9/21/2008 11:14 AM To: Li, Bingshan Cc: r-help@r-project.org Subject: RE: [R] How to plot "greater than" symbol on the x-axis D

[R] R Map using SAS data

2008-09-21 Thread Junjie Zhang
Hi there, I'd like to plot some maps. Is it possible for me to use SAS map data in R? Thank you. Best, Junjie _ your life. [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] Symmetric matrix

2008-09-21 Thread Dimitris Rizopoulos
try the following a <- matrix(rnorm(36), 6) ind <- lower.tri(a) a[ind] <- t(a)[ind] a I hope it helps. Best, Dimitris Megh Dal wrote: I have following matrix : a = matrix(rnorm(36), 6) Now I want to replace the lower-triangular elements with it's upper-triangular elements. That is I want

Re: [R] Symmetric matrix

2008-09-21 Thread Jorge Ivan Velez
Dear Megh, Try this: a = matrix(rnorm(36), 6) a[upper.tri(a)]<-a[lower.tri(a)] a HTH, Jorge On Sun, Sep 21, 2008 at 1:47 PM, Megh Dal <[EMAIL PROTECTED]> wrote: > I have following matrix : > > a = matrix(rnorm(36), 6) > > Now I want to replace the lower-triangular elements with it's > upper

[R] Symmetric matrix

2008-09-21 Thread Megh Dal
I have following matrix : a = matrix(rnorm(36), 6) Now I want to replace the lower-triangular elements with it's upper-triangular elements. That is I want to make a symmetric matrix from a. I have tried with lower.tri() and upper.tri() function, but got desired result. Can anyone please tell m

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread Gabor Grothendieck
On Sun, Sep 21, 2008 at 11:23 AM, Li, Bingshan <[EMAIL PROTECTED]> wrote: > Hi John, > > Yes, you are right. I meant "greater-than-or-equal". According to your > suggestion, I can plot the symbol only. But what I want is to have >=1, >=2 > and so on as labels on xaxis. I did not make it work. Do

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread Henrik Bengtsson
On Sun, Sep 21, 2008 at 9:52 AM, Henrik Bengtsson <[EMAIL PROTECTED]> wrote: > What have you tried this far and what part does not work? If you > forget for a moment the fact that you want to have ">=1", ">=2", ... > can you do what you want with plain "1", "2", ...? Telling us that > helps us he

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread Henrik Bengtsson
What have you tried this far and what part does not work? If you forget for a moment the fact that you want to have ">=1", ">=2", ... can you do what you want with plain "1", "2", ...? Telling us that helps us help you. Are you asking for the labels on the *tick marks* on the axis? Right now it

Re: [R] Variable Selection for data reduction and discriminant anlaysis

2008-09-21 Thread Katharine Mullen
There are some pointers to packages for variable selection in the task view for Chemometrics and Computational Physics at http://cran.r-project.org/web/views/ChemPhys.html On Sun, 21 Sep 2008, Gareth Campbell wrote: > Hello all, > > I'm dealing with geochemical analyses of some rocks. > > If I us

[R] Task View for Chemometrics and Computational Physics

2008-09-21 Thread Katharine Mullen
Dear All, A new task view "ChemPhys" on chemometrics and computational physics is available on CRAN (http://cran.r-project.org/web/views/ChemPhys.html). It describes packages and functions that are of use in modeling chemical/physical systems. Suggestions and comments regarding this task view are

Re: [R] periodicity validation

2008-09-21 Thread stephen sefick
alright this is what you want to do. install.packages("fields", dependencies=TRUE) tim.colors is in this package and it has a blue to red color scheme- blue being the lowest and red being the highest. This color scheme makes sense to me and is a common thing that a people (read engineers) familar

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread John Fox
Dear Bingshan, You can use xlab=expression("" >= "1"), xlab=expression("" >= 1), or expression(NA >= 1), etc. The point is that >= is a binary operator, so a well formed expression needs both a left- and right-hand operand. John -- John Fox, Professor Department of So

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread Li, Bingshan
Hi John, Yes, you are right. I meant "greater-than-or-equal". According to your suggestion, I can plot the symbol only. But what I want is to have >=1, >=2 and so on as labels on xaxis. I did not make it work. Do you know how to make it? The expression("">=1"") did not work, and paste(expressio

Re: [R] Design lrm function

2008-09-21 Thread milicic.marko
Thanks Frank. On Sep 20, 2:53 am, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote: > milicic.marko wrote: > > Hi, > > > Is it possible to get ROC and accuracy ratio/gini straight out of the > > Design package? > > > Thanks > > The print method for lrm prints the ROC area (labeled "C").  lrm does > no

Re: [R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread John Fox
Dear Bingshan, It isn't entirely clear what you want to do. I think that you want the "greater-than-or-equal-to" symbol, not "greater than," but by itself or in an expression? For the first, xlab=expression("" >= ""), and for the second, e.g., xlab=expression(x >= x[min]). More generally, see ?plo

[R] How to plot "greater than" symbol on the x-axis

2008-09-21 Thread Li, Bingshan
Hello everyone, I want to plot a "greater than" symbol (the "_" under ">") on the x-axis in the labels. Is it possible to do it? Thanks. Bingshan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Calculating interval for conditional/unconditional correlation matrix

2008-09-21 Thread Ana Kolar
Hi there, Could anyone please help me to understand what should be done in order not to get this error message: Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Here is my code: determinant<- function(x){det(matrix(c(1.0,0.2,0.5,0.8,0.2,1.0,0.5,0.6,0.5,0.5,0.5,1

Re: [R] AUC / ROC for presence only.

2008-09-21 Thread Núria Roura Pascual
Dear Miltinho, It depends on the species (rare or widespread), and also on how well its distribution is known. You have to make some assumptions about where the species might not be present and generate the pseudo-absences in these areas. However, other people just simply create pseudo-absence da

[R] How to put given values in lower triangle of splom-plot?

2008-09-21 Thread Hofert Marius
Dear R-experts, I have found a splom-modification online which is given below. This works perfectly, but I would like to have a matrix of given correlation values to be used in the lower triangular part (lower.panel) of the splom-plot instead of calculated correlation values. Here is the

Re: [R] Variable Selection for data reduction and discriminant anlaysis

2008-09-21 Thread Mark Difford
Hi Gareth, >> If I use the full composition (31 elements or variables), I can get >> reasonable separation of my 6 sources. A word of advice: You need to be exceptionally careful when analyzing compositional data. Taking compositions puts your data values into a constrained/bounded space (genera

Re: [R] Oja median

2008-09-21 Thread Rahul-A.Agarwal
Hi Could any one help me to code tukey half space depth and directinal quantile regression in R Rahul Agarwal Analyst Equities Quantitative Research UBS_ISC, Hyderabad On Net: 19 533 6363 -Original Message- From: roger [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2008