[R] Simulate data with binary outcome

2008-07-15 Thread Steve Frost
Dear R-Users, I wish to simulate a binary outcome data set with predictors (in the example below, age, sex and systolic BP). Is there a way I can set the frequency of the outcome (y) to be say 5% (versus the 0.1% when using the seed below)? # Example R-code based on Frank Harrell's De

[R] negative P-values with shapiro.test

2008-07-15 Thread Mark Cowley
Dear list, I am analysing a set of quantitative proteomics data from 16 patients which has a large numbers of missing data, thus some proteins are only detected once, upto a maximum of 16. I want to test each protein for normality by the Shapiro Wilk test (function shapiro.test in package st

Re: [R] Help Updating and Installing R Packages

2008-07-15 Thread Vincent Goulet
Tariq, See inline for my reply. Le mar. 15 juil. à 21:48, Tariq Perwez a écrit : Hi Everyone, I have a few fairly basic questions about upgrading and installing R packages. First off, I am using Ubuntu Hardy Heron and have R 2.7.1 installed and working perfectly. I usually access R via Emacs

Re: [R] Insurance review statistical methods

2008-07-15 Thread Vincent Goulet
I don't know about TRICAST, but package actuar (on CRAN) provides some more specifically actuarial functionality to R. You may want to have a look. See also http://www.actuar-project.org, Le lun. 14 juil. à 17:47, Kenneth Roy Cabrera Torres a écrit : Hi R users: I will like to know if some

[R] How to extract component number of RMSEP in RMSEP plot

2008-07-15 Thread Jason Lee
Hi R-listers, I would like to know how can i extract component no. when the RMSEP is lowest? Currently, I only plot it manually and then only feed the ncomp to the jack knife command. However, I would like to automate this step. Please let me know. Many thanks. Rgrds, [[alternative HTM

[R] Off-topic - Data needed

2008-07-15 Thread Bogaso Cristofer
Hi, I needed a historical time series data on number of students are in different subjects in their MS and Ph.D courses in US like how many students took Statistics, how many are physics, nuclear physics etc, for at least last 10 years. Can anyone give me some idea on how I can from where I can

[R] Help Updating and Installing R Packages

2008-07-15 Thread Tariq Perwez
Hi Everyone, I have a few fairly basic questions about upgrading and installing R packages. First off, I am using Ubuntu Hardy Heron and have R 2.7.1 installed and working perfectly. I usually access R via Emacs ESS interface which I am still trying to get the hang of. My questions and issues are

Re: [R] meaning of tests presented in anova(ols(...)) {Design package}

2008-07-15 Thread Frank E Harrell Jr
Dylan Beaudette wrote: Hi, I am curious about how to interpret the table produced by anova(ols(...)), from the Design package. I have a multiple linear regression model, with some interaction, defined by: ols(formula = log(ksat * 60 * 60) ~ log(sar) * pol(activity, 3) + log(conc) * pol(sand

Re: [R] code reduction (if anyone feels like it)

2008-07-15 Thread jim holtman
Typo in the last one: (resend) #GPS in Decimal Degrees in the form longitude latitude (raw data) library(maptools) # create a list of the coords coordList <- list( RM215 = matrix(c(-82.1461363, 33.5959109), nrow=1), SC = matrix(c(-82.025888, 33.606454), nrow=1) , RM202 = matrix(c(-81.9906723

Re: [R] code reduction (if anyone feels like it)

2008-07-15 Thread jim holtman
Here is what I would do: #GPS in Decimal Degrees in the form longitude latitude (raw data) library(maptools) # create a list of the coords coordList <- list( RM215 = matrix(c(-82.1461363, 33.5959109), nrow=1), SC = matrix(c(-82.025888, 33.606454), nrow=1) , RM202 = matrix(c(-81.9906723, 33.5

Re: [R] New Zealand Maps

2008-07-15 Thread Ray Brownrigg
Actually, http://www.stats.govt.nz/statistics-by-area/geography-mapping/download-digital-boundaries.htm is probably better. Ray On Wed, 16 Jul 2008, Tom Love wrote: > Can anyone point me to a map file for New Zealand Territorial Local > Authorities? Apologies if this is obvious, but I'm rather

[R] R logo

2008-07-15 Thread Christophe Genolini
Hi the list, I like the R logo (grey C and blue R) very much, specialy the drawing of the letter with border and shadow. I would like to make something closed with some other letters. Does anyone know how to get a similar result ? Christophe __ R-h

Re: [R] Row Sum, exclude positive values

2008-07-15 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jim Lemon > Sent: Tuesday, July 15, 2008 5:03 PM > To: Rheannon > Cc: r-help@r-project.org > Subject: Re: [R] Row Sum, exclude positive values > > On Tue, 2008-07-15 at 14:35 -0700, Rheannon wrote: > >

Re: [R] New Zealand Maps

2008-07-15 Thread Ray Brownrigg
Did you find: http://koordinates.com/find/?page=5 ? HTH Ray Brownrigg MSCS Victoria University On Wed, 16 Jul 2008, Tom Love wrote: > Can anyone point me to a map file for New Zealand Territorial Local > Authorities? Apologies if this is obvious, but I'm rather new to > mapping things, and after

Re: [R] Row Sum, exclude positive values

2008-07-15 Thread Jim Lemon
On Tue, 2008-07-15 at 14:35 -0700, Rheannon wrote: > Hello, > > I'd like to sum the values of a row from the first negative number (FN) to > the last negative number (LN), but not add any positive values to the sum. > Then apply this to each row of the data frame. > > For example if I have a data

[R] New Zealand Maps

2008-07-15 Thread Tom Love
Can anyone point me to a map file for New Zealand Territorial Local Authorities? Apologies if this is obvious, but I'm rather new to mapping things, and after an R search and a general Google search I can't see anything which seems quite right. I'm hoping that there is a publicly availabl

[R] implementation of Prentice method in cch()

2008-07-15 Thread Jin Wang
Case cohort function cch() is in survival package. In cch(), the prentice method is implemented like this: Prentice <- function(tenter, texit, cc, id, X, ntot,robust){ eps <- 0.0001 cens <- as.numeric(cc>0) # Censorship indicators subcoh <- as.numeric(cc<2) # Subcohort indicators

Re: [R] Row Sum, exclude positive values

2008-07-15 Thread Jorge Ivan Velez
Dear Rheannon, Try DF = c(4, 3, 2, 1, 0, -1, -2, -3, -2, 2, 1, -1, -2, -3, -2, -1, 1, 2) sum(DF[DF<0]) [1] -17 HTH, Jorge On Tue, Jul 15, 2008 at 5:35 PM, Rheannon <[EMAIL PROTECTED]> wrote: > > Hello, > > I'd like to sum the values of a row from the first negative number (FN) to > the last

[R] Row Sum, exclude positive values

2008-07-15 Thread Rheannon
Hello, I'd like to sum the values of a row from the first negative number (FN) to the last negative number (LN), but not add any positive values to the sum. Then apply this to each row of the data frame. For example if I have a dataframe with Row 1 values DF = (4, 3, 2, 1, 0, -1, -2, -3, -2, 2,

Re: [R] Mapping data onto 1-10 score

2008-07-15 Thread Jim Lemon
On Tue, 2008-07-15 at 05:16 -0700, rcoder wrote: > Hi everyone, > > I want to score a set of data (-ve to +ve) using a 0-10 scale. I have the > data in an R matrix, so I need to add another column, containing the scores > and resave. > Hi rcoder, Maybe rescale (plotrix package) is what you want:

Re: [R] code reduction (if anyone feels like it)

2008-07-15 Thread stephen sefick
#GPS in Decimal Degrees in the form longitude latitude (raw data) library(maptools) RM215 <- matrix(c(-82.1461363, 33.5959109), nrow=1) SC <- matrix(c(-82.025888, 33.606454), nrow=1) RM202 <- matrix(c(-81.9906723, 33.5027653), nrow=1) RM198 <- matrix(c(-81.926823, 33.4634678), nrow=1) HC <- ma

Re: [R] Exporting an list()

2008-07-15 Thread Jim Lemon
On Tue, 2008-07-15 at 10:10 -0300, Leandro Marino wrote: > Hi, > > I have an list() like this: > > $VAR1 > Num Perc media stdev min P5P10P25 > 1 4381 56.35 181.35 39.81 87.13 123.05 132.59 152.95 > 2 1628 20.94 192.83 43.76 87.13 125.09 138.78 162.04 > 3786 10.11

Re: [R] Convert data set to data frame

2008-07-15 Thread Jim Lemon
On Mon, 2008-07-14 at 14:40 -0700, Willa Wei wrote: > Now, I want to have a > data frame looks like shown below so that I can save it into my > database: > > Level mean medianvar sdvalid.n > 2 6.11 1.29 2885 53.72 8.3

Re: [R] Off topic: Tcl/Tk outside R.

2008-07-15 Thread Jim Lemon
On Tue, 2008-07-15 at 08:28 +1200, Rolf Turner wrote: > ... > Yeah, well I see that it works for you --- but it doesn't work for me! > I.e. my original script doesn't work, but Peter D.'s modification > does work. > > Dang! Why are ``they'' always picking on me? :-) > Hi Rolf, I have had the sa

Re: [R] Mapping data onto score

2008-07-15 Thread rcoder
Thank you Ben! This is very clear. rcoder Ben Tupper wrote: > > > On Jul 15, 2008, at 5:16 PM, rcoder wrote: > >> >> Hi Ben, >> Yes, this is more or less what I want to do. I want to apply this >> data in >> columns in a matrix, and insert the results to additional columns. >> I am not >>

Re: [R] Melt (reshape) question

2008-07-15 Thread Steve Murray
Thanks very much to you both - it worked a treat! Steve _ 100’s of Nikon cameras to be won with Live Search __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

Re: [R] Melt (reshape) question

2008-07-15 Thread hadley wickham
> Am > I right in thinking that this *should* also remove the -99s (NA > values)? Because at present, the lower end ot the file looks like this: Judging from your output, the -99's haven't been converted to NA's - you can fix this (and the 88s) by doing: PopDens[PopDens == -99] <- NA PopDens[PopD

Re: [R] tryCatch - return from function to main script

2008-07-15 Thread jim holtman
Can you provide an example of what you have tried. This should work: for(i in 1:4){ x <- try(yourFunction(...)) if (class(x) = "try-error") print('had a problem") } On Tue, Jul 15, 2008 at 6:59 AM, Anne-Marie Ternes <[EMAIL PROTECTED]> wrote: > Dear helpers, > > I've got a main script, w

Re: [R] code reduction (if anyone feels like it)

2008-07-15 Thread jim holtman
I am reasonably sure that it could be more efficient, but it would be very helpfulto have some comments in the code and a description of "what is the problem you are trying to solve". It looks like you can setup some lists and process them more compactly. On Tue, Jul 15, 2008 at 3:21 PM, stephen

Re: [R] What package to use to create a GUI

2008-07-15 Thread Bert Gunter
tcltk (which is part of the standard distribution) if you want fine control; or perhaps gWidgets will suffice. There are others (rJava, RGtk2, ...) Also check the Cran website, as there is a GUI section there. -- Bert Gunter Genentech -Original Message- From: [EMAIL PROTECTED] [mailto:[E

Re: [R] Melt (reshape) question

2008-07-15 Thread jim holtman
Probably as the result of read.table without any headers, the column names are "V1"..."V720". You need to add new column names. You have statements: colnames <- columnnames rownames <- rnames Are you assuming that these are assigning row/column names to the structure? Try colnames(PopDen) <-

[R] What package to use to create a GUI

2008-07-15 Thread Judith Flores
Hello dead R-experts, I work on x86_64-suse-linux and I am using R 2.7.1. I created several scripts that will be used by several people that are not familiar with R. I would like to create a GUI to call the scripts that the users would choose to run, also, the GUI should allow them to choose

Re: [R] Filtering output

2008-07-15 Thread jim holtman
?factor If all you want is the character value, then do: as.character(sc[[1]]$Category[1]) On Tue, Jul 15, 2008 at 4:37 PM, <[EMAIL PROTECTED]> wrote: > I have a command which returns a data fram if I am not mistaken: > > sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) > > Now I w

Re: [R] Mapping data onto score

2008-07-15 Thread Ben Tupper
On Jul 15, 2008, at 5:16 PM, rcoder wrote: Hi Ben, Yes, this is more or less what I want to do. I want to apply this data in columns in a matrix, and insert the results to additional columns. I am not entirely aware of a good way of doing this. e.g. take data from column B, apply normali

Re: [R] Mapping data onto score

2008-07-15 Thread rcoder
Hi Ben, Yes, this is more or less what I want to do. I want to apply this data in columns in a matrix, and insert the results to additional columns. I am not entirely aware of a good way of doing this. e.g. take data from column B, apply normalisation, and feed output into column C Thanks, rcod

Re: [R] Iterations

2008-07-15 Thread Rolf Turner
On 16/07/2008, at 7:40 AM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: Thank you. ?for just gives me a + rompt indicating that I need to supply more input. The same with ?while and ?repeat. Help(for) yelds: help(for) Error: unexpected ')' in "help(for)" But thanks for the tip.

Re: [R] playwith package crashes on Mac

2008-07-15 Thread Michael Lawrence
For some reason, cairoDevice has been crashing the Mac for a while. It has something to do with the rotation of text through Pango. That's all I've been able to determine. Kind of tough without access to a Mac... but it DID work once upon a time.. 2008/7/15 Felix Andrews <[EMAIL PROTECTED]>: > De

[R] Filtering output

2008-07-15 Thread rkevinburton
I have a command which returns a data fram if I am not mistaken: sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) Now I wish to get the Category and SubCategory that the data was split on. So my first attempt would be: sc[[1]]$Category[1] But that yields [1] (Unknown) 46 Levels: (U

Re: [R] Mapping data onto score

2008-07-15 Thread Ben Tupper
On Jul 15, 2008, at 8:16 AM, rcoder wrote: Hi everyone, I want to score a set of data (-ve to +ve) using a 0-10 scale. I have the data in an R matrix, so I need to add another column, containing the scores and resave. Hi, I am a little fuzzy on what you are asking, but my guess is th

[R] Melt (reshape) question

2008-07-15 Thread Steve Murray
Dear all, I have a grid of 720 columns by 360 rows of global population density values, and hope to convert this to column format using the 'melt' command in the 'reshape' package. I'm not receiving any errors as such, but when the code has finished running, my output looks like this: > head(P

Re: [R] Font quality in base graphics

2008-07-15 Thread Mike Prager
willemf wrote on 07/15/2008 08:42 AM: > I am attempting to get publication quality graphs using R on Ubuntu. I > encounter lots of problems in using cex to control font size: for instance > cex=1.5 results in very blocky characters. I then tried to use res=1200 > while creating a PNG file, hoping t

Re: [R] matplot help

2008-07-15 Thread Boyce, Morgan
Thank you both. I managed to accomplish this tack with your help. date = ts(time, start =1985, freq =4) quarters = as.Date(time(date)) z = length(quarters) win.graph() par(mfrow=c(1,1),mex=0.7,bg="white") matplot(1:n,corp.check,type="l",lty=1, col=2, ylab="$",xlab="",xaxt="n") title(main="C

Re: [R] Font quality in base graphics

2008-07-15 Thread willemf
Thank you Jeff, I will follow up on this. I just cannot believe that R does not have a good command of this. The obvious route is Postscript ourput, since it is not raster-based and one can incorporate EPS files into OpenOffice documents. However, when printing to a Postscript device, there is no

[R] how to get confidential interval for classification accuracy using 10-fold validation in svm package

2008-07-15 Thread larry88
I am just starting to use R language, and jumped into using svm (e1071) model to do classification analysis using svm. Meanwhile, I used 10-fold cross validation to evaluate initial classification accuracy. Now I am going to run for example 100 times cross validation to determine the distribution

Re: [R] .First and .Rprofile won't run on startup

2008-07-15 Thread Susan Amrose
Thanks to everyone for the help and advice! It turns out that my problem was using $HOME in the .First function in Rprofile.site. Since $HOME is a user specific variable, it seems to have crashed when running from the $R_HOME/etc/ directory. I added the other .Rprofile files without deletng the Rpr

[R] sem & testing multiple hypotheses with BIC

2008-07-15 Thread Donald Braman
I'm coming from the AMOS world and am wondering if there is a simple way to do multiple hypothesis testing in the manner of BIC analyses in AMOS using the sem package in R. I've read the documentation, but don't see anything in there except for basic BIC scores. Perhaps someone has devised a simp

Re: [R] Iterations

2008-07-15 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: Tuesday, July 15, 2008 12:40 PM > To: Erik Iverson > Cc: [EMAIL PROTECTED] > Subject: Re: [R] Iterations > > Thank you. > > ?for just gives me a + rompt indicating that I

Re: [R] Iterations

2008-07-15 Thread Erik Iverson
Sorry, I'm in ESS. Try ?Control [EMAIL PROTECTED] wrote: Thank you. ?for just gives me a + rompt indicating that I need to supply more input. The same with ?while and ?repeat. Help(for) yelds: > help(for) Error: unexpected ')' in "help(for)" But thanks for the tip. Keivn Erik Iverso

Re: [R] Font quality in base graphics

2008-07-15 Thread Mark Difford
Hi wf >> I just cannot believe that R does not have a good command of this. Curious. I find R's graphical output matchless. Almost without exception I use postscript and find the controls available under base graphics (?par) or "lattice" adequate (to understate). Very occassionally I fiddle with

Re: [R] POSIXct extract time

2008-07-15 Thread stephen sefick
sorry this should work On Tue, Jul 15, 2008 at 3:50 PM, stephen sefick <[EMAIL PROTECTED]> wrote: RM215 <- matrix(c(-82.1461363, 33.5959109), nrow=1) > RM215.sp <- SpatialPoints(RM215, proj4string=CRS("+proj=longlat > +datum=WGS84")) > d060101 <- as.POSIXct("2006-01-01", tz="EST") > study_seq <- s

Re: [R] POSIXct extract time

2008-07-15 Thread Henrique Dallazuanna
Try this: format(down.215$time, "%H:%M:%S") On Tue, Jul 15, 2008 at 4:50 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > RM215.sp <- SpatialPoints(RM215, proj4string=CRS("+proj=longlat > +datum=WGS84")) > d060101 <- as.POSIXct("2006-01-01", tz="EST") > study_seq <- seq(from=d060101, length.out=76

[R] generalized spatial autoregressive lag model

2008-07-15 Thread De Tuimelaar
R 2.7, WinXP Hi, I am interested in estimating the spatial autoregressive lag model y = rWy +Xb + e where W is a square matrix of weights, r an autocorrelation parameter, b a vector of coefficients, X a matrix of covariates. There are several packages in R that can estimate this model (sna, spde

[R] POSIXct extract time

2008-07-15 Thread stephen sefick
RM215.sp <- SpatialPoints(RM215, proj4string=CRS("+proj=longlat +datum=WGS84")) d060101 <- as.POSIXct("2006-01-01", tz="EST") study_seq <- seq(from=d060101, length.out=761, by="days") up.215 <- sunriset(RM215.sp, study_seq, direction="sunrise", POSIXct.out=TRUE) down.215 <- sunriset(RM215.sp, study

Re: [R] Iterations

2008-07-15 Thread rkevinburton
Thank you. ?for just gives me a + rompt indicating that I need to supply more input. The same with ?while and ?repeat. Help(for) yelds: > help(for) Error: unexpected ')' in "help(for)" But thanks for the tip. Keivn Erik Iverson <[EMAIL PROTECTED]> wrote: > If you read the help page, ?f

Re: [R] Iterations

2008-07-15 Thread rkevinburton
Sorry I missed the print part. When nothing was output I assumed that nothing happened. Thank you. Kevin Erik Iverson <[EMAIL PROTECTED]> wrote: > If you read the help page, ?for, you might have seen under "Value", that > > 'for', 'while' and 'repeat' return the value of the last >

[R] code reduction (if anyone feels like it)

2008-07-15 Thread stephen sefick
# I am sure that I could be more efficient than this but how? Thanks in advance. #GPS in Decimal Degrees in the form longitude latitude RM215 <- matrix(c(-82.1461363, 33.5959109), nrow=1) SC <- matrix(c(-82.025888, 33.606454), nrow=1) RM202 <- matrix(c(-81.9906723, 33.5027653), nrow=1) RM198 <- m

[R] INSEED statistics workshop on Statistical Models and Practices in Epidemiology (using R)

2008-07-15 Thread INSEED statistics workshop
Dear Friends, INSEED announces following workshop this year. "Statistical Models and Practices in Epidemiology (using R)" to be organised jointly with the Department of Statistics, Manipal University, Karnataka from 24-28 November, 2008. For details, see the workshop website http://www.inseed.org

Re: [R] extracting elements from print object of Manova()

2008-07-15 Thread Jorge Ivan Velez
Dear Michael, Does it work for you? tear <- c(6.5, 6.2, 5.8, 6.5, 6.5, 6.9, 7.2, 6.9, 6.1, 6.3, 6.7, 6.6, 7.2, 7.1, 6.8, 7.1, 7.0, 7.2, 7.5, 7.6) gloss <- c(9.5, 9.9, 9.6, 9.6, 9.2, 9.1, 10.0, 9.9, 9.5, 9.4, 9.1, 9.3, 8.3, 8.4, 8.5, 9.2, 8.8, 9.7, 10.1, 9.2) opacity <- c(4.4,

[R] INSEED Statistics Workshop on Bayesian statistics using OpenBUGS and R

2008-07-15 Thread INSEED statistics workshop
Dear Friends, INSEED announces following workshop this year. "Bayesian statistics using OpenBUGS and R" to be organised at the Department of Statistics, St. Thomas College, Pala, Kerala from 08-12 December, 2008. This is the second workshop of its kind. For details, see the workshop website http

Re: [R] Regression problem

2008-07-15 Thread Erik Iverson
Douglas Bates wrote: On Tue, Jul 15, 2008 at 10:25 AM, Patrick Burns <[EMAIL PROTECTED]> wrote: That can be accomplished with 8 keystrokes. A hint is to do the 4 keystrokes: ?lm Umm - unless you are counting the implicit , that's only 3 keystrokes isn't it? You give away that you're an Em

Re: [R] Font quality in base graphics

2008-07-15 Thread Jeffrey Horner
willemf wrote on 07/15/2008 08:42 AM: I am attempting to get publication quality graphs using R on Ubuntu. I encounter lots of problems in using cex to control font size: for instance cex=1.5 results in very blocky characters. I then tried to use res=1200 while creating a PNG file, hoping that th

Re: [R] Iterations

2008-07-15 Thread Erik Iverson
If you read the help page, ?for, you might have seen under "Value", that 'for', 'while' and 'repeat' return the value of the last expression evaluated (or 'NULL' if none was), invisibly. So if you want to see the values, print() them. In general, from the first part of your message, i

Re: [R] Iterations

2008-07-15 Thread Michael Rennie
Oops, typo- sorry, should be for(i in 1:10) { print(i) } Mike On Tue, Jul 15, 2008 at 1:39 PM, Michael Rennie <[EMAIL PROTECTED]> wrote: > for(1 in 1:10) > { > print(i) > } > > Mike > > On Tue, Jul 15, 2008 at 1:11 PM, <[EMAIL PROTECTED]> wrote: >> I have a command th

[R] Help with maptools sunriset()

2008-07-15 Thread stephen sefick
library(maptools) RM215 <- matrix(c(33.5959109, -82.1461363), nrow=1) RM215.sp <- SpatialPoints(RM215, proj4string=CRS("+proj=longlat +datum=WGS84")) d060101 <- as.POSIXct("2006-01-01") study_seq <- seq(from=d060101, length.out=761, by="days") up <- sunriset(RM215, study_seq, direction="sunrise", P

Re: [R] Iterations

2008-07-15 Thread Michael Rennie
for(1 in 1:10) { print(i) } Mike On Tue, Jul 15, 2008 at 1:11 PM, <[EMAIL PROTECTED]> wrote: > I have a command that reads in some data: > > x <- read.csv("Sales2007.dat", header=TRUE) > > Then I try to organize the data: > > sc <- split(x, list(x$Category, x$SubCategory), drop=TR

Re: [R] Iterations

2008-07-15 Thread Jeff Newmiller
[EMAIL PROTECTED] wrote: I have a command that reads in some data: x <- read.csv("Sales2007.dat", header=TRUE) Then I try to organize the data: sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) Then I want to iterate through the data. I was able to get the following to run on the R

Re: [R] Regression problem

2008-07-15 Thread Douglas Bates
On Tue, Jul 15, 2008 at 10:25 AM, Patrick Burns <[EMAIL PROTECTED]> wrote: > That can be accomplished with 8 keystrokes. > A hint is to do the 4 keystrokes: > ?lm Umm - unless you are counting the implicit , that's only 3 keystrokes isn't it? > Angila Albaros wrote: >> >> Hello all, >>

Re: [R] sunrise sunset calculations

2008-07-15 Thread stephen sefick
Is there a way to use a time zone independant in the sunriset function. We have kept our instruments on eastern standard time. Any help would be great! On Tue, Jul 15, 2008 at 1:06 PM, Chuck Cleland <[EMAIL PROTECTED]> wrote: > On 7/15/2008 12:52 PM, stephen sefick wrote: > >> Does anyone know

Re: [R] Iterations

2008-07-15 Thread Stephan Kolassa
Kevin, By default, many functions only *return* a result, they don't explicitly *print* it. There is no difference in interactive mode, but there is in batch mode (e.g., in loops). Use print() or cat() for explicit printing to console. for(i in 1:100) { cat(i,"\n") } HTH, Stephan [EMA

Re: [R] counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"

2008-07-15 Thread Riley, Steve
Daren, Not sure if it is any easier, but another solution is: code <- unlist(strsplit("TCGACAATCGGTAACCCGTCT","")) length(grep("[G]",code)) Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daren Tan Sent: Tuesday, July 15, 2008 11:28 AM T

Re: [R] Problem installing R on openSUSE 10.3

2008-07-15 Thread Detlef Steuer
On Tue, 15 Jul 2008 07:08:24 -0700 (PDT) A Ezhil <[EMAIL PROTECTED]> wrote: > Dear All, > > I am trying to install R 2.7 on my openSUSE 10.3. I have faithfully followed > instruction at http://cran.r-project.org/bin/linux/suse/ReadMe.txt. I have > downloaded all the RPMs but still R complains

[R] Iterations

2008-07-15 Thread rkevinburton
I have a command that reads in some data: x <- read.csv("Sales2007.dat", header=TRUE) Then I try to organize the data: sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) Then I want to iterate through the data. I was able to get the following to run on the R console: for(i in 1:length

Re: [R] sunrise sunset calculations

2008-07-15 Thread Chuck Cleland
On 7/15/2008 12:52 PM, stephen sefick wrote: Does anyone know if there is a sunrise sunset calculator for R? RSiteSearch("sunrise", restrict="function") points to several related functions in the maptools package. -- Chuck Cleland, Ph.D. NDRI, Inc. (www.ndri.org) 71 West 23rd Street, 8th fl

[R] aov error with large data set

2008-07-15 Thread Mike Lawrence
I'm looking to analyze a large data set: a within-Ss 2*2*1500 design with 20 Ss. However, aov() gives me an error, reproducible as follows: id = factor(1:20) a = factor(1:2) b = factor(1:2) d = factor(1:1500) temp = expand.grid(id=id, a=a, b=b, d=d) temp$y = rnorm(length(temp[, 1])) #generate s

Re: [R] Problem installing R on openSUSE 10.3

2008-07-15 Thread A Ezhil
Hi, I didn't try automatic dependency resolution instead installed each library one by one. It seems that tcl is installed and the libtcl8.4.so exists. Below is the info from the system: > rpm -q tcl tcl-8.4.15-22 > whereis libtcl8.4.so libtcl8.4: /usr/lib64/libtcl8.4.so > rpm -i R-base-2.7.1-6.

[R] sunrise sunset calculations

2008-07-15 Thread stephen sefick
Does anyone know if there is a sunrise sunset calculator for R? -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little probl

[R] Calculating Stream Metabolism

2008-07-15 Thread stephen sefick
are there any packages that calculate stream metabolism. thanks Stephen -- Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying litt

Re: [R] counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"

2008-07-15 Thread Patrick Aboyoun
Henrik, As Wolfgang mentioned, the Biostrings package in Bioconductor has a number of sequence manipulation functions. The alphabetFrequency function would get you what you need. > library(Biostrings) > alphabetFrequency(DNAString("TCGACAATCGGTAACCCGTCT")) A C G T M R W S Y K V H D B N - +

Re: [R] counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"

2008-07-15 Thread Wolfgang Huber
Hi, And the Bioconductor package "Biostrings" is the place to go for any serious work with sequences. -- Best wishes Wolfgang -- Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber 15/07/2008 16:43 Henrik Bengtsson

Re: [R] manipulating (extracting) data from distance matrices

2008-07-15 Thread Michael Rennie
Hi Jon, That only controls the print display of the matrix, not how one can access the elements. I think my solution revolves around indexing in as.matrix() with a mind to the fact that results will be duplicated along the diagonal. Cheers, and thanks all, Mike On Tue, Jul 15, 2008 at 11:43 AM,

Re: [R] manipulating (extracting) data from distance matrices

2008-07-15 Thread Sarah Goslee
The ecodist package has a convenience function full() that converts a dist object to a symmetric matrix. After that subsetting works normally. lower() performs the reverse operation. Sarah -- Sarah Goslee http://www.functionaldiversity.org __ R-help

Re: [R] manipulating (extracting) data from distance matrices

2008-07-15 Thread Jon Olav Skoien
Maybe dmat<-dist(dat, method="euclidean",upper = TRUE,diag = TRUE) can fix your problem with the triangular matrix? Cheers Jon Michael Rennie wrote: Not really, I'd actually want f[4:6,4:6] to get comparisons of observations 4 to 6 only. And I'm still left with the upper triangular matrix.

Re: [R] counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"

2008-07-15 Thread Henrik Bengtsson
Seems like you can do: library("matchprobes") # on Bioconductor countbases("TCGACAATCGGTAACCCGTCT")[,"G"] The catch is that it only counts A, C, G, and T:s and no other symbols. /Henrik On Tue, Jul 15, 2008 at 8:27 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > Any better solution than this

Re: [R] counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"

2008-07-15 Thread Ken Knoblauch
Daren Tan hotmail.com> writes: > Any better solution than this ? > sum(strsplit("TCGACAATCGGTAACCCGTCT", "")[[1]] == "G") Try table(strsplit("TCGACAATCGGTAACCCGTCT", "")) A C G T 5 7 8 5 and get all 4 at once. HTH -- Ken Knoblauch Inserm U846 Institut Cellule Souche et Cerveau D

[R] counting number of "G" in "TCGGGGGACAATCGGTAACCCGTCT"

2008-07-15 Thread Daren Tan
Any better solution than this ? sum(strsplit("TCGACAATCGGTAACCCGTCT", "")[[1]] == "G") _ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://s

Re: [R] enscript states file for R scripts?

2008-07-15 Thread [EMAIL PROTECTED]
On 15 июл, 13:23, "hadley wickham" <[EMAIL PROTECTED]> wrote: > An alternative to enscript is > highlight,http://www.andre-simon.de/doku/highlight/en/highlight.html, which > does > come with R highlighting built in. > > Hadley > Thanks for pointing this out. But I think I actually need enscript

Re: [R] Regression problem

2008-07-15 Thread Patrick Burns
That can be accomplished with 8 keystrokes. A hint is to do the 4 keystrokes: ?lm Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Angila Albaros wrote: Hello all, I am new to r programmean

[R] Font quality in base graphics

2008-07-15 Thread willemf
I am attempting to get publication quality graphs using R on Ubuntu. I encounter lots of problems in using cex to control font size: for instance cex=1.5 results in very blocky characters. I then tried to use res=1200 while creating a PNG file, hoping that this would solve the problem, but it did

[R] Regression problem

2008-07-15 Thread Angila Albaros
Hello all, I am new to r programmeand need help. I want to do multiple linear regression analysis. say, I have two matrix 'x' and 'y'. I want, 'x' as my response variable and 'y' as predictor. Each time one column of 'x' will be the response, say x[,1], then next x[,2] and so on.

[R] extracting elements from print object of Manova()

2008-07-15 Thread Michael Rennie
Hi there, Does anyone know how to extract elements from the table returned by Manova()? Using the univariate equivalent, Anova(), it's easy: a.an<-Anova(lm(y~x1*x2)) a.an$F This will return a vector of the F-values in order of the terms of the model. However, a similar application using Manov

Re: [R] long data frame selection error

2008-07-15 Thread John Kane
You are not selecting the headers (column names)of a dataframe. You seem to be creating a new data.frame consisting of those names. It should give you a 1Xn dataframe. Is that what you intended to do? What errors message do you get at V188? --- On Mon, 7/14/08, Rheannon <[EMAIL PROTECTED]> wr

Re: [R] randomForest outlier

2008-07-15 Thread Birgitle
Still the same question: Birgitle wrote: > > I try to use ?randomForest to find variables that are the most important > to divide my dataset (continuous, categorical variables) in two given > groups. > > But when I plot the outlier: > > plot(outlier(rfObject, cls=groupingVariable), > type="p"

[R] DOE for logistic models

2008-07-15 Thread Jeremy MAZET
Hello everyone, Is there any tools to build experimental designs for logistic models? Thanks, Jérémy Mazet Département Génie des procédés SOREDAB La Tremblaye 78125 La Boissière Ecole Tel : 01 34 94 37 09 [[alternative HTML version deleted]] _

Re: [R] playwith package crashes on Mac

2008-07-15 Thread Felix Andrews
Dear Professor Kubovy I do not have a Mac to test it on, but please try this: library(cairoDevice) Cairo() grid::grid.newpage() I expect that you will see a similar crash; if so, it would seem to be a problem with your GTK+ libraries. I have heard that you need to have Apple X11 installed (from M

[R] Problem installing R on openSUSE 10.3

2008-07-15 Thread A Ezhil
Dear All, I am trying to install R 2.7 on my openSUSE 10.3. I have faithfully followed instruction at http://cran.r-project.org/bin/linux/suse/ReadMe.txt. I have downloaded all the RPMs but still R complains about: libtcl8.4.so is needed by R-base-2.7.1-6.1.i586 I searched for this library and

Re: [R] Random Forest %var(y)

2008-07-15 Thread Liaw, Andy
Better late than never, I suppose: The second column is simply the first column divided by the variance of the response that have been OOB up to that point (20 trees), times 100. Best, Andy From: David Katz > > The verbose option gives a display like: > > > rf.500 <- > + randomForest(new.x,

Re: [R] manipulating (extracting) data from distance matrices

2008-07-15 Thread Michael Rennie
Not really, I'd actually want f[4:6,4:6] to get comparisons of observations 4 to 6 only. And I'm still left with the upper triangular matrix. This is a problem since I want to sum the distances over the blocks that I am extracting. Then again, I could just divide the sum by two and get the answ

Re: [R] Exporting an list()

2008-07-15 Thread Jorge Ivan Velez
Dear Leandro, Another option could be sink(). See ?sink for more information. Here is an example: x = list(VAR1 = data.frame(x=rnorm(10), y=rnorm(10)), VAR2 = data.frame(x=rnorm(10), y=rnorm(10))) sink("C:/list1.txt") x sink() HTH, Jorge On Tue, Jul 15, 2008 at 9:10 AM, Leandro Mari

Re: [R] enscript states file for R scripts?

2008-07-15 Thread Dirk Eddelbuettel
On 15 July 2008 at 17:23, hadley wickham wrote: | An alternative to enscript is highlight, | http://www.andre-simon.de/doku/highlight/en/highlight.html, which does | come with R highlighting built in. Another alternative is GNU a2ps which has definitions for R source, documentation and transcript

Re: [R] manipulating (extracting) data from distance matrices

2008-07-15 Thread stephen sefick
how about this f <- as.matrix(dmat) f[,4:6] #you get repeats but I think this is what you want On Tue, Jul 15, 2008 at 9:07 AM, Michael Rennie <[EMAIL PROTECTED]> wrote: > Hi all, > > Does anyone have any tips for extracting chunks of data from a distance > matrix? > > For instance, if one was in

  1   2   >