Re: [R] batch file execution

2005-10-14 Thread sosman
jun xu wrote: > I am new to R and really like to get a handle of basics in short period of > time. What I am trying to do is get myself a list of must-do's (read in > data, batch execution, delimiters, basic modeling commands) in R as in Stata > or SAS. I am just wondering how to execute a R batch

Re: [R] Beginner plot and map questions

2005-10-14 Thread vincent
Web User a écrit : > 1.) Is there a way to convert a table (e.g. represented as a data frame) > to a function, specifying which columns are input and which column is > output? It would seem that this would be useful for plotting > experimental results, since e.g. contour(x, y, f) requires f to

[R] batch file execution

2005-10-14 Thread jun xu
I am new to R and really like to get a handle of basics in short period of time. What I am trying to do is get myself a list of must-do's (read in data, batch execution, delimiters, basic modeling commands) in R as in Stata or SAS. I am just wondering how to execute a R batch file in RGui. Suppose

Re: [R] Do Users of Nonlinear Mixed Effects Models Know Whether Their Software Really Works?

2005-10-14 Thread Andrew Robinson
Dear Hans, these are interesting points. I guess that I'm approaching it from the point of view of a decision: I'd be more comfortable using a fitting routine that has stability under a wide range of identifiable circumstances. Obtaining the MLE exactly in any instance is a function of the data a

[R] Help with lattice, regressions and respective lines

2005-10-14 Thread Jose Claudio Faria
# Dear R list, # # I'm needing help with lattice, regression and respective lines. # My data is below: bra = gl(2, 24, label = c('c', 's')) em = rep(gl(3, 8, label = c('po', 'pov', 'ce')), 2) tem = rep(c(0, 0, 30, 30, 60, 60, 90, 90), 6) tem2 = tem^2 r= rep(1:2, 24) y= c(40.58, 44.85,

Re: [R] Question about Boxplots

2005-10-14 Thread Berton Gunter
?par ?plot.default In particular you want to set the ylim parameter. However, note that the axis drawing procedures try to choose "pretty" axis labels. These can be changed by using low level tools -- see ?axis. Please also read "An Introduction to R" and other relevant docs before posting. Base

[R] subset selection for glm

2005-10-14 Thread Dhiren DSouza
Hello: Are there any libraries that will do a subset selection for glm's? I looked through leaps, but seems like it is specifically for linear regressions. Thank you. -Dhiren __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/lis

[R] Question about Boxplots

2005-10-14 Thread Rodrigo Medel
Hello, I'm a new R user and I like to ask somethig about boxplots. Is it possible to manipulate the Y axis scale? for instance if the default scale was from 1 to 7, is it possible to change it to 1 to 10? Thanks! Rodrigo Medel P. __ R-help@stat.math.e

Re: [R] lattice with predicted values

2005-10-14 Thread Deepayan Sarkar
On 10/14/05, Martin Henry H. Stevens <[EMAIL PROTECTED]> wrote: > Dear lattice wizards, > > I am trying to figure out how to plot predicted values in xyplot, > where the intercept, but not the slope, varies among conditioning > factor levels. I am sure it involves the groups, but I have been > unsu

Re: [R] Which cex to change in a trellis plot

2005-10-14 Thread Deepayan Sarkar
On 10/14/05, Andy Bunn <[EMAIL PROTECTED]> wrote: > Given: > > > foo <- data.frame(bar = rnorm(100), > fac1 = factor(rep(1:2, 50)), > fac2 = > factor(c(rep(c("a","b","SomethingReallyReallyReallyLong"), 33),"a"))) > bwplot(bar~fac1|fac2, data = foo) > > How do I c

[R] Beginner plot and map questions

2005-10-14 Thread Web User
Hi, I have not been able to find answers to these questions in the FAQs, manuals, or R-help archives. If answers are available somewhere, please direct me to them. 1.) Is there a way to convert a table (e.g. represented as a data frame) to a function, specifying which columns are input and wh

[R] Fw: Setting working directory interactively within a function

2005-10-14 Thread Michel Friesenhahn
>On 10/14/2005 1:08 PM, Berton Gunter wrote: >> ?setwd >> e.g. setwd(file.choose()) >> >> BTW, you could have found this on your own via help.search('working >> directory') . Base R has quite good docs -- you should try them first. >> >> -- Bert Gunter > >That won't work in Windows, where the dia

Re: [R] Sweave +RWinEdt

2005-10-14 Thread Uwe Ligges
Arnab mukherji wrote: > Hi! > > I was just reading Uwe Ligges write up on extending R-WinEdt for Sweave from > 2003; I was wondering if there were updates on it? Are people seriously > thiking about it? > > I really use WinEdt a lot, and for not just R, and hence this kind of > extension wou

Re: [R] Setting working directory interactively within a function

2005-10-14 Thread Gabor Grothendieck
library(tcltk) setwd(tclvalue(tkchooseDirectory())) On 10/14/05, Paul Baer <[EMAIL PROTECTED]> wrote: > Is there anyway to have a function prompt the user for a working > directory, equivalent to file.choose()? __ R-help@stat.math.ethz.ch mailing list h

Re: [R] Setting working directory interactively within a function

2005-10-14 Thread Berton Gunter
Oops. Thanks, all. Egg on my face. I forgot about that little detail (on Windows, anyway). However, you can still do it via dirname(file.choose()) to get the directory, on Windows,anyway, right? If that isn't implemented on another platform, than you could mimic the dirname() code by using gsub()

[R] Sweave +RWinEdt

2005-10-14 Thread Arnab mukherji
Hi! I was just reading Uwe Ligges write up on extending R-WinEdt for Sweave from 2003; I was wondering if there were updates on it? Are people seriously thiking about it? I really use WinEdt a lot, and for not just R, and hence this kind of extension would be really cool for a whole range peo

Re: [R] Predicting classification error from rpart

2005-10-14 Thread Andy Bunn
Anthony. Look at ?predict.rpart, I think this might be the kind of table you are looking for. data(iris) sub <- c(sample(1:50, 25), sample(51:100, 25), sample(101:150, 25)) fit <- rpart(Species ~ ., data=iris, subset=sub) fit table(predict(fit, iris[-sub,], type="class"),

[R] Predicting classification error from rpart

2005-10-14 Thread Anthony Staines
Hi, I think I'm missing something very obvious, but I am missing it, so I would be very grateful for help. I'm using rpart to analyse data on skull base morphology, essentially predicting sex from one or several skull base measurements. The sex of the people whose skulls are being studied is known

Re: [R] Setting working directory interactively within a function

2005-10-14 Thread Duncan Murdoch
On 10/14/2005 1:08 PM, Berton Gunter wrote: > ?setwd > e.g. setwd(file.choose()) > > BTW, you could have found this on your own via help.search('working > directory') . Base R has quite good docs -- you should try them first. > > -- Bert Gunter That won't work in Windows, where the dialogs don't

Re: [R] shell scripts in R

2005-10-14 Thread Greg Snow
Marc Schwartz <[EMAIL PROTECTED]> 10/13/05 06:07PM >>> >On Fri, 2005-10-14 at 00:39 +0200, Benedict P. Barszcz wrote: >> Dnia piatek, 14 pazdziernika 2005 00:13, Sundar Dorai-Raj napisal: >> >> > Don't you mean system("ls")? See ?system. >> > >> > Arguments: >> > >> > command: the system comm

Re: [R] Setting working directory interactively within a function

2005-10-14 Thread Duncan Murdoch
On 10/14/2005 12:55 PM, Paul Baer wrote: > Is there anyway to have a function prompt the user for a working > directory, equivalent to file.choose()? It's relatively easy to get a text prompt, but I don't think we've got a function that's equivalent to the Windows menu item "File|Change dir..."

Re: [R] Setting working directory interactively within a function

2005-10-14 Thread Berton Gunter
?setwd e.g. setwd(file.choose()) BTW, you could have found this on your own via help.search('working directory') . Base R has quite good docs -- you should try them first. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA "The business of the statistician is to catalyze t

Re: [R] high resolution images for publication

2005-10-14 Thread Knut Krueger
Chris Buddenhagen schrieb: >Dear all > > > >I am using R to produce ordinations library(vegan) and the plot function >produced looks great on the screen but when I send it to jpg or pdf or eps >the resolution is not so good. Can you tell me how to get high resolution >images out of R for public

[R] Setting working directory interactively within a function

2005-10-14 Thread Paul Baer
Is there anyway to have a function prompt the user for a working directory, equivalent to file.choose()? --Paul __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project

Re: [R] run many linear regressions against the same independent variables in batch

2005-10-14 Thread Heng Sun
Thank you Gabor. I suspected R could do that. But I tried a data frame and it did not work. Now I test for matrix and it works. So it seems performing many regressions in one shot works for a matrix, but not a data frame. Heng Gabor Grothendieck <[EMAIL PROTECTED]> 10/14/2005 12:05 PM To

[R] lattice with predicted values

2005-10-14 Thread Martin Henry H. Stevens
Dear lattice wizards, I am trying to figure out how to plot predicted values in xyplot, where the intercept, but not the slope, varies among conditioning factor levels. I am sure it involves the groups, but I have been unsuccessful in my search in Pinhiero and Bate, in the help files, or i

Re: [R] run many linear regressions against the same independent variables in batch

2005-10-14 Thread Huntsinger, Reid
I have always used lsfit() for this, but have been told that lm() is preferred, and I note the help for lm() states If 'response' is a matrix a linear model is fitted separately by least-squares to each column of the matrix. Reid Huntsinger -Original Message- From: [EMAIL PROTEC

[R] arguments of lpSolve

2005-10-14 Thread Sara Mouro
Dear all, I am a beginner with lpSolve package (and not an expert in the others). I can not understand why I am doing wrong, and I would be very grateful if anyone could please help me on this. I am trying to optimize ("min") the sum of columns/variables, constrained to >=1. Each column/variable

Re: [R] run many linear regressions against the same independent variables in batch

2005-10-14 Thread Gabor Grothendieck
This runs a regression of each column (except the first) of matrix state.x77 against the first: lm(state.x77[,-1] ~ state.x77[,1]) On 10/14/05, Heng Sun <[EMAIL PROTECTED]> wrote: > R function > lm(response ~ term) > allows me to run a linear regression on a single response vector. For > example,

Re: [R] Converting PROC NLMIXED code to NLME

2005-10-14 Thread Singh, Jatinder
Hi Peter, Apologies - I ran the script using S-Plus 6.2. I am happy to run it in R, but my feeling is that there may be something wrong with the code itself. I have included the dataset and script, in case you can help. Jindi Singh. Jatinder Singh Senior Manager, Analysis and Reporting PRA I

[R] run many linear regressions against the same independent variables in batch

2005-10-14 Thread Heng Sun
R function lm(response ~ term) allows me to run a linear regression on a single response vector. For example, I have recent one year historical prices for a stock and S&P index. I can run regression of the stock prices (as response vector) against the S&P index prices (as term vector). Now ass

[R] Which cex to change in a trellis plot

2005-10-14 Thread Andy Bunn
Given: foo <- data.frame(bar = rnorm(100), fac1 = factor(rep(1:2, 50)), fac2 = factor(c(rep(c("a","b","SomethingReallyReallyReallyLong"), 33),"a"))) bwplot(bar~fac1|fac2, data = foo) How do I change the size of the text for fac2? I need to make the "SomethingR

Re: [R] shell scripts in R

2005-10-14 Thread Yves Magliulo
Le ven 14/10/2005 à 00:39, Benedict P. Barszcz a écrit : > Dnia piątek, 14 października 2005 00:13, Sundar Dorai-Raj napisał: > > > Don't you mean system("ls")? See ?system. > > > > Arguments: > > > > command: the system command to be invoked, as a string. > > This is the kind of obstacles

[R] question about ?list

2005-10-14 Thread ronggui
the help page says: 'is.list' returns 'TRUE' iff its argument is a 'list' _or_ a 'pairlist' of 'length' > 0, whereas 'is.pairlist' only returns 'TRUE' in the latter case. does the "latter case" mean a 'pairlist' of 'length' > 0? but > is.pairlist(pairlist()) [1] TRUE > length(pairli

Re: [R] R & OLAP engines, an integration?

2005-10-14 Thread Jim Porzak
Hi Emmanuel, We are doing some work along these lines. See www.OpenI.org for details of our open souce OLAP solution & contact our CTO, Sandeep Giri (via link on that site), for details. We haven't released any R integration yet, but we are doing some things internally & it is on the OpenI develop

Re: [R] shell scripts in R

2005-10-14 Thread Don MacQueen
But, > foo <- 'ls' > system(foo) is valid. Is foo a "string" or a "quoted string"? Without a doubt, it is the former. But I don't see any quote marks in system(foo) -Don At 12:39 AM +0200 10/14/05, Benedict P. Barszcz wrote: >Dnia piàtek, 14 paêdziernika 2005 00:13, Sundar Dorai-Raj

Re: [R] extracting from data frame multiple times

2005-10-14 Thread Thomas Lumley
On Fri, 14 Oct 2005, Ido M. Tamir wrote: > Hello, > i am trying to subset a dataframe multiple times: > something like: > > stats <- by(df, list(items), ttestData) > > ttestData <- function(df){ >t.test( df[,c(2,3,4), df[,c(5,6,7)] > } > > While this works for small data, it is to slow for my

[R] R & OLAP engines, an integration?

2005-10-14 Thread Emmanuel Maroye
Hi. I am a consultant at KAE: Marketing Intelligence (http://www.kae.co.uk) working on market evaluation and forecasting. Working on large datasets I am looking for a solution to use R on datasets stored in an OLAP engine (like MIS Alea, Applix TM1 or Mondrian). Have you ever heard about such

Re: [R] mtext: rotating text

2005-10-14 Thread Uwe Ligges
Jonathan Dushoff wrote: > Recently, I was trying to make an inward-facing label for a vertical > axis on the right-hand side of a plot. The inward-facing label was > required by a journal. I searched R-help, but the only solution I found > was to use text, which requires fiddling with the x-coor

[R] mtext: rotating text

2005-10-14 Thread Jonathan Dushoff
Recently, I was trying to make an inward-facing label for a vertical axis on the right-hand side of a plot. The inward-facing label was required by a journal. I searched R-help, but the only solution I found was to use text, which requires fiddling with the x-coordinate for each plot. What would

[R] extracting from data frame multiple times

2005-10-14 Thread Ido M. Tamir
Hello, i am trying to subset a dataframe multiple times: something like: stats <- by(df, list(items), ttestData) ttestData <- function(df){ t.test( df[,c(2,3,4), df[,c(5,6,7)] } While this works for small data, it is to slow for my actual data: 50 rows dataframe with about 135000 differ

Re: [R] R: source

2005-10-14 Thread Gabor Grothendieck
On 10/14/05, Clark Allan <[EMAIL PROTECTED]> wrote: > hi all > > i have a quick question > > i would like to use the source command but i keep on getting an error > > eg > > source("c:/research file/model.txt") > > > > the problem seems to be because of the space in the file name but this > is how

[R] Do Users of Nonlinear Mixed Effects Models Know Whether Their Software Really Works?

2005-10-14 Thread Hans Julius Skaug
Dear Andrew and R-list, I guess Fournier is addressing the properties of the numerical routines underlying the various packages, not the statistical properties of the MLE itself. For this purpose using a small tricky dataset makes sense. Clearly, a true unique MLE exists (except in pathological

Re: [R] fast and stable way to read data in R

2005-10-14 Thread Prof Brian Ripley
On Fri, 14 Oct 2005, Wensui Liu wrote: > Dear useRs, > > I am wondering what is the most fast and stable way to read data (pretty > large) into R. Right now, the methods I could think of are: > 1) use read.table to read *.csv or *txt > 2) use RODBC to read excel or access > > But I don't know whic

[R] fast and stable way to read data in R

2005-10-14 Thread Wensui Liu
Dear useRs, I am wondering what is the most fast and stable way to read data (pretty large) into R. Right now, the methods I could think of are: 1) use read.table to read *.csv or *txt 2) use RODBC to read excel or access But I don't know which is better. Thanks for your sugggestion. -- WenSui

Re: [R] zip package

2005-10-14 Thread Peter Dalgaard
Uwe Ligges <[EMAIL PROTECTED]> writes: > Sara Mouro wrote: > > > Dear all > > > > I can not understand how to install the package lpsolve_1.1.9.zip > > > > I have read the FAQ and the help pages carefully, but it still not > > clear for me. > > > > I have tried the following (a

Re: [R] R: source

2005-10-14 Thread Doran, Harold
Use file.choose() instead > source(file.choose()) This will open a dialogue box and might be easier for you to find your file. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clark Allan Sent: Friday, October 14, 2005 7:06 AM To: r-help@stat.math.ethz.c

Re: [R] zip package

2005-10-14 Thread John Fox
Dear Sara, It looks to me as if there are three problems here: (1) Is the zip file for the package really at "c:/ProgramFiles/R/rw2011/library/lpSolve_1.1.9"? That is, isn't there a space in "Program Files"? (2) You have to specify repos=NULL to install from a local zip file, as ?install.packages

[R] R: source

2005-10-14 Thread Clark Allan
hi all i have a quick question i would like to use the source command but i keep on getting an error eg source("c:/research file/model.txt") the problem seems to be because of the space in the file name but this is how windows references the folder name. i dont want to change the folder n

Re: [R] zip package

2005-10-14 Thread Uwe Ligges
Sara Mouro wrote: > Dear all > > I can not understand how to install the package lpsolve_1.1.9.zip > > I have read the FAQ and the help pages carefully, but it still not > clear for me. > > I have tried the following (and obtained the respective error > messages): > >

Re: [R] zip package

2005-10-14 Thread John Sorkin
Sara, Could it be that you have to unzip the package? If you are using a PC you can probably find a free (or trial version) of one of many versions of unzip (e.g. WINZIP). If you are familiar with Unix, unzipping is similar to using TAR. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Inf

Re: [R] aggregate slow with many rows - alternative?

2005-10-14 Thread Hans-Peter
Many thanks for all your answers. Converting to a matrix didn't help, I tried with Hmisc but didn't get anywhere (different summary functions, multiple levels). 2005/10/14, jim holtman <[EMAIL PROTECTED]>: > Here is the way that I would do it. Using 'lapply' to process the list and > create a ma

Re: [R] arima: warning when fixing MA parameters.

2005-10-14 Thread Prof Brian Ripley
It's a bug: the code has 1:arma[1], i.e. 1:0. Replace by seq(length=arma[1]). On Thu, 13 Oct 2005, John Maindonald wrote: > I am puzzled by the warning message in the output below. It appears > whether or not I fit the seasonal term (but the precise point of doing > this was to fit what is eff

[R] zip package

2005-10-14 Thread Sara Mouro
Dear all I can not understand how to install the package lpsolve_1.1.9.zip I have read the FAQ and the help pages carefully, but it still not clear for me. I have tried the following (and obtained the respective error messages): >install.packages("c:/Pro

Re: [R] aggregate slow with many rows - alternative?

2005-10-14 Thread jim holtman
Here is the way that I would do it. Using 'lapply' to process the list and create a matrix; take less than 1 second: > dat <- data.frame(D=sample(32000:33000, 33000, T), + Fid=sample(1:10,33000,T), A=sample(1:5,33000,T)) > system.time({ + result <- lapply(split(seq(nrow(dat)), dat$D), function(.d)

Re: [R] dataframe (matrix) multiplication

2005-10-14 Thread Peter Wolf
where is the problem? input: A<-c(2,3,2); B<-c(1,2,1); C<-c(4,4,5); D<-c(3,5,4) df<-data.frame(A,B,C,D) c1<-1:2; c2<-3:4 df[,c1]*df[,c2] output: A B 1 8 3 2 12 10 3 10 4 Peter Wolf Christoph Scherber wrote: >Dear R users, > >Suppose I have 2 parts of a dataframe, say > >ABCD >2143 >3245

[R] dataframe (matrix) multiplication

2005-10-14 Thread Christoph Scherber
Dear R users, Suppose I have 2 parts of a dataframe, say ABCD 2143 3245 2154 (the real dataframe is 160 columns with each 120 rows) and I want to multiply every element in [,A:B] with every element in [,C:D]; What is the most elegant way to do this? I´ve been thinking of converting [,A:B] to a

Re: [R] aggregate slow with many rows - alternative?

2005-10-14 Thread TEMPL Matthias
Hi, Yesterday, I have analysed data with 16 rows and 10 columns. Aggregation would be impossible with a data frame format, but when converting it to a matrix with *numeric* entries (check, if the variables are of class numeric!) the computation needs only 7 seconds on a Pentium III. I´m sad

Re: [R] Fortran?

2005-10-14 Thread Peter Dalgaard
"Sam R. Smith" <[EMAIL PROTECTED]> writes: > In a package, i type a function name and got the following message: > ... > tmp <- .Fortran("master", x = as.double(x), y = as.double(y), > sort = as.logical(sort), rw = as.double(rw), npd = > as.integer(npd), > ntot = as.int

Re: [R] Fortran?

2005-10-14 Thread Roger Bivand
On Fri, 14 Oct 2005, Sam R. Smith wrote: > In a package, i type a function name and got the following message: > ... > tmp <- .Fortran("master", x = as.double(x), y = as.double(y), > sort = as.logical(sort), rw = as.double(rw), npd = > as.integer(npd), > ntot = as.integ

[R] Fortran?

2005-10-14 Thread Sam R. Smith
In a package, i type a function name and got the following message: ... tmp <- .Fortran("master", x = as.double(x), y = as.double(y), sort = as.logical(sort), rw = as.double(rw), npd = as.integer(npd), ntot = as.integer(ntot), nadj = integer(tadj), madj = as.integer(madj