[R] Sweave and size10.clo

2007-05-05 Thread Tom Schenk Jr.
Using Sweave on Windows (MikTeX 2.5 and R 2.4.1), I've ran into a bit of a problem with the tex -> DVI process. First, I've corrected the common \usepackage error by using \usepackage{"C:/Program Files/R/R-2.4.1/share/texmf/Sweave"} to get around the spacing problem. That is, LaTeX is finding the

Re: [R] loop in function

2007-05-05 Thread Stephen Tucker
Actually I am not sure what you want exactly, but is it df1 <-data.frame(b=c(1,2,3,4,5,5,6,7,8,9,10)) df2 <-data.frame(x=c(1,2,3,4,5), y=c(2,5,4,6,5), z=c(10, 8, 7, 9, 3)) df1 <- cbind(df1, "colnames<-"(sapply(with(df2,(x+y)/z), function(a,b) a/b,b=df1

Re: [R] simple table ordering question

2007-05-05 Thread jim holtman
Convert them to factors in which you specify the order: > mytable<-factor(c(rep("Disagree",37),rep("Agree",64)), > levels=c("Disagree","Agree")) > table(mytable) mytable DisagreeAgree 37 64 On 5/5/07, AP05 <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm sure this is simple but I do

[R] simple table ordering question

2007-05-05 Thread AP05
Hi all, I'm sure this is simple but I don't get it. I have a table mytable<-c(rep("Disagree",37),rep("Agree",64)) table(mytable) this gives me AgreeDisagree 6437 but I didn't ask for it to be in alphabetic order. How can I get it in original order? DisagreeAgree 37

[R] Creating contingency table from mixed data

2007-05-05 Thread spime
Hi, I am new in R. Please help me in the following case. I have data in hand: http://www.nabble.com/file/8225/Data.txt Data.txt There are some categorical (binary and nominal) and continuous variables. How can i get a generic RXC contingency table from this table? My main objective is to fine

[R] NA in wilcox.test

2007-05-05 Thread Michelle Emily DePrenger-Levin
Hello, I'm trying to compare the allozyme data from two taxa. I have several columns of data (19 loci) for each species. I want to do a Mann-Whitney U-test or the wilcox.test (two sample Wilcoxon). When I try to run my code (the first two columns are 1:name of the species, 2:name of individual) I

Re: [R] Convert Time from HH.mm to Decimal hours?

2007-05-05 Thread jim holtman
Is this what you want? > x <- seq(as.POSIXct("2006-05-05 12:00"), by="17 min", length=20) > x [1] "2006-05-05 12:00:00 GMT" "2006-05-05 12:17:00 GMT" "2006-05-05 12:34:00 GMT" [4] "2006-05-05 12:51:00 GMT" "2006-05-05 13:08:00 GMT" "2006-05-05 13:25:00 GMT" [7] "2006-05-05 13:42:00 GMT" "2006-0

Re: [R] the ifelse function

2007-05-05 Thread jim holtman
Can you proovide the example you are talking about. Here is what I got: > ifelse(NA,1,2) [1] NA On 5/5/07, Jennifer Dillon <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > I think I found a problem with the ifelse function: If the condition > argument is NA, it treats it as true. Anyone agree or

Re: [R] the ifelse function

2007-05-05 Thread Chuck Cleland
Jennifer Dillon wrote: > Hi Everyone, > > I think I found a problem with the ifelse function: If the condition > argument is NA, it treats it as true. Anyone agree or disagree with this? I disagree. > ifelse(c(5,4,NA) == 5, 1, 0) [1] 1 0 NA > Jen -- Chuck Cleland, Ph.D. NDRI, Inc. 71 We

[R] the ifelse function

2007-05-05 Thread Jennifer Dillon
Hi Everyone, I think I found a problem with the ifelse function: If the condition argument is NA, it treats it as true. Anyone agree or disagree with this? Jen -- Jennifer Dillon Doctoral Student Harvard Biostatistics Room 414B, Building 1 [[alternative HTML version deleted]] __

Re: [R] pseudo-R2 or GOF for regression trees?

2007-05-05 Thread Prof Brian Ripley
On Sat, 5 May 2007, Prof. Jeffrey Cardille wrote: Hello, Is there an accepted way to convey, for regression trees, something akin to R-squared? Why not use R-squared itself for your purposes? Just get the fitted values from however you do the fit, and compute R-squared from the basic formul

Re: [R] pseudo-R2 or GOF for regression trees?

2007-05-05 Thread Frank E Harrell Jr
Prof. Jeffrey Cardille wrote: > Hello, > > Is there an accepted way to convey, for regression trees, something > akin to R-squared? > > I'm developing regression trees for a continuous y variable and I'd > like to say how well they are doing. In particular, I'm analyzing the > results of a

[R] pseudo-R2 or GOF for regression trees?

2007-05-05 Thread Prof. Jeffrey Cardille
All-- Apologies if I have inadvertently posted this message twice; I just joined the list today, after trying to post once. Thanks- Jeff # r-help message is below # Hello, Is there an accepted way to convey, for regression trees, something akin to R-squared? I'm developing regression tree

Re: [R] nlme fixed effects specification

2007-05-05 Thread Douglas Bates
On 5/4/07, ivo welch <[EMAIL PROTECTED]> wrote: hi doug: yikes. could I have done better? Oh dear. I tried to make my example clearer half-way through, but made it worse. I meant set.seed(1); fe = as.factor( as.integer( runif(100)*10 ) ); y=rnorm(100); x=rnorm(100); print(summary(lm( y ~

[R] pseudo-R2 or GOF for regression trees?

2007-05-05 Thread Prof. Jeffrey Cardille
Hello, Is there an accepted way to convey, for regression trees, something akin to R-squared? I'm developing regression trees for a continuous y variable and I'd like to say how well they are doing. In particular, I'm analyzing the results of a simulation model having highly non-linear beha

[R] Convert Time from HH.mm to Decimal hours?

2007-05-05 Thread Alan E. Davis
I have data in Unixtime that I wish to plot several ways. I have learned to convert to a vector of time strings, and for the sake of plotting times of day vs. heights of tide (to examine seasonality component) I can extract HH:mm pretty swiftly and readily from Unixtime using emacs calc. However,

Re: [R] How to latex tables?

2007-05-05 Thread Marc Schwartz
On Sat, 2007-05-05 at 11:35 -0500, Marc Schwartz wrote: > On Sat, 2007-05-05 at 09:43 -0400, steve wrote: > > Suppose I have a table constructed from structable or simply just an > > object of class table. How can I convert it to a latex object? I looked > > in RSiteSearch, but only found info ab

Re: [R] How to latex tables?

2007-05-05 Thread Marc Schwartz
On Sat, 2007-05-05 at 09:43 -0400, steve wrote: > Suppose I have a table constructed from structable or simply just an > object of class table. How can I convert it to a latex object? I looked > in RSiteSearch, but only found info about matrices or data frames. > > Steve > > > For example, her

Re: [R] rgl install on rhel4 x86_64

2007-05-05 Thread Smith, Troy \(NIH/NCI\) [C]
Thanks. I did successfully install Friday afternoon using the configure script from version 0.68, however the library would not load, so I removed the package. I will attempt to build a new configure script using autoconf on Monday morning. Thanks much for your feedback, I really appreciate i

Re: [R] (no subject)

2007-05-05 Thread jim holtman
>From you function, it looks like you want to return 5 values for each element in the vector 'df1'. Is this what you want? I am not sure what you expect the output to look like. > df1 <-data.frame(b=c(1,2,3,4,5,5,6,7,8,9,10)) > df2 <-data.frame(x=c(1,2,3,4,5), y=c(2,5,4,6,5), z=c(10, 8, 7, 9, 3)

[R] loop in function

2007-05-05 Thread sumfleth
Dear Mailing-List, I think this is a newbie question. However, i would like to integrate a loop in the function below. So that the script calculates for each variable within the dataframe df1 the connecting data in df2. Actually it takes only the first row. I hope that's clear. My goal is to apply

Re: [R] nlme fixed effects specification

2007-05-05 Thread roger koenker
Ivo, I don't know whether you ever got a proper answer to this question. Here is a kludgy one -- someone else can probably provide a more elegant version of my diffid function. What you want to do is sweep out the mean deviations from both y and x based on the factor fe and then estimate the sim

[R] (no subject)

2007-05-05 Thread sumfleth
Dear Mailing-List, I think this is a newbie question. However, i would like to integrate a loop in the function below. So that the script calculates for each variable within the dataframe df1 the connecting data in df2. Actually it takes only the first row. I hope that's clear. My goal is to apply

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Duncan Murdoch
On 05/05/2007 9:36 AM, Greg Snow wrote: > If we go the route of converting Perl scripts into windows executables, then > there is the Perl Power Tools (ppt) project for perl that aims to create a > cross platform set of common Unix tools (see > http://sourceforge.net/projects/ppt/, or the curre

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Gabor Grothendieck
I think its actually here: http://search.cpan.org/dist/ppt/ but would have the significant disadvantage of deepening the use of perl whereas I think the direction should be to get rid of perl. On 5/5/07, Greg Snow <[EMAIL PROTECTED]> wrote: > > If we go the route of converting Perl scripts into

[R] Response as matrix in MCMClogit?

2007-05-05 Thread francogrex
I hope some of the authors of the package MCMCpack read this. I don't know if there is a way to set the response in the model formula of MCMClogit other than a (numeric) response vector. I think the MCMClogit in the MCMCpack needs some development so that the response in the formula could be set

[R] How to latex tables?

2007-05-05 Thread steve
Suppose I have a table constructed from structable or simply just an object of class table. How can I convert it to a latex object? I looked in RSiteSearch, but only found info about matrices or data frames. Steve For example, here is a table t2 > str(t2) table [1:2, 1:2, 1:2] 6 8 594

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Greg Snow
If we go the route of converting Perl scripts into windows executables, then there is the Perl Power Tools (ppt) project for perl that aims to create a cross platform set of common Unix tools (see http://sourceforge.net/projects/ppt/, or the current toolset can be downloaded from CPAN). The f

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Greg Snow
I am glad to help. The pp program is the main tool to use to create the executable. -Original Message- From: "Duncan Murdoch" <[EMAIL PROTECTED]> To: "Greg Snow" <[EMAIL PROTECTED]> Cc: "Gabor Grothendieck" <[EMAIL PROTECTED]>; "Doran, Harold" <[EMAIL PROTECTED]>; "r-help@stat.math.ethz

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Gabor Grothendieck
Surely the idea of having a separate windows version of R is that it works in a very Windows-like way and that would preclude having conflicts with standard utilities on Windows. To me this is one of the most annoying things about R since I do use other Windows software and that includes software

Re: [R] save intermediate result

2007-05-05 Thread jim holtman
Break your long running function into two parts. The first will be the long running part and it can return a value that you can pass to the second part. If the second part fails, you still have the original value that was returned. f1.1 <- function(){ line1 <- f2() return(line1) } f1.2

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Duncan Murdoch
On 05/05/2007 8:00 AM, Gabor Grothendieck wrote: > I think that should be the default in order to protect the user. Protecting > the user from this sort of annoying conflict is important for a professionally > working product that gets along with the rest of the Windows system. I don't, because R

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Gabor Grothendieck
I think that should be the default in order to protect the user. Protecting the user from this sort of annoying conflict is important for a professionally working product that gets along with the rest of the Windows system. On 5/5/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 04/05/2007 9:32

Re: [R] [SPAM] - Re: R package development in windows - BayesianFilter detected spam

2007-05-05 Thread Duncan Murdoch
On 04/05/2007 9:32 PM, Gabor Grothendieck wrote: > It certainly would be excellent if installing perl could be eliminated. > > One additional thing that I really dislike about the R installation is that > one needs "find" on one's path and that conflicts with "find" on Windows > so other applicati

Re: [R] save intermediate result

2007-05-05 Thread Joerg van den Hoff
On Fri, May 04, 2007 at 04:55:36PM -0400, Weiwei Shi wrote: > sorry for my English, staying in US over 7 years makes me think I were > ok, now :( > > anyway, here is an example and why I need that: > > suppose I have a function like the following: > > f1 <- function(){ > line1 <- f2() # assume t

Re: [R] dynamically specifying regressors/RHS variables in a regression

2007-05-05 Thread Gabor Grothendieck
Using the builtin data frame CO2 this regresses uptake, which is variable number 5, against each consecutive pair of variables: for(i in 1:3) { idx <- c(i, i+1, 5) print(lm(uptake ~., CO2[idx])) } On 5/5/07, Victor Bennett <[EMAIL PROTECTED]> wrote: > Does anyone know if there is a way t

Re: [R] Help with map

2007-05-05 Thread Roger Bivand
On Sat, 5 May 2007, Alberto Vieira Ferreira Monteiro wrote: > [for those that worry about these things, this _is_ a homework > assignment. However, it's not an R homework, it's a Geography > and History homework... and I want to use R to create a pretty > map] > > Roger Bivand wrote: > > > >> Is