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

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

[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

[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

Re: [R] position of a specific character

2008-07-15 Thread Prof Brian Ripley
On Mon, 14 Jul 2008, Erik Iverson wrote: gregexpr("\\(", frg) Better gregexpr("(", frg, fixed=TRUE) (there is no regular expression here), but in this case which(unlist(strsplit(frg, "")) == "(") is more efficient (especially if you want to do further manipulations on the individual c

[R] Proxy again, this time on a Mac

2008-07-15 Thread LostInTimeAndSpace
Hi! My problem: i can't use the automatic package installation via the GUI since I am behind a Proxy. I tried installing Authoxy which solved the Problem for some other programs but not for R. I'm really new to R and Mac and therefore a bit confused... I can't find any internet connection setting

[R] enscript states file for R scripts?

2008-07-15 Thread [EMAIL PROTECTED]
Hi group! GNU enscript is a free (as in freedom) text file decorator, which among other features can highlight source code files. The language syntax descriptions are provided via special "states" files. The standard distribution contains states files for the most popular languages (C, C++, Pascal

[R] Supressing printing from a function: ecdf

2008-07-15 Thread tolga . i . uzuner
Dear R Users, I am trying to suppress the information printed by the ecdf function during an assignment. Various alternatives have failed me so far: > a=summary(ecdf(rnorm(100)))["1st Qu."] Empirical CDF:100 unique values with summary > invisible(a=summary(ecdf(rnorm(100)))["1st Qu."]) Empir

Re: [R] Supressing printing from a function: ecdf

2008-07-15 Thread Patrick Burns
If you do: getAnywhere('summary.ecdf') you will see the 'cat' statement that is doing the printing that is annoying you. It seems to me that a better definition of the function would have an argument called something like 'verbose' that controlled if the 'cat' statement was executed. I'm not s

Re: [R] Proxy again, this time on a Mac

2008-07-15 Thread Prof Brian Ripley
On Tue, 15 Jul 2008, LostInTimeAndSpace wrote: Hi! My problem: i can't use the automatic package installation via the GUI since I am behind a Proxy. I tried installing Authoxy which solved the Problem for some other programs but not for R. I'm really new to R and Mac and therefore a bit confus

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

2008-07-15 Thread Mark Difford
Hi Dylan, >> I am curious about how to interpret the table produced by >> anova(ols(...)), from the Design package. Frank will perhaps come in with more detail, but if he doesn't then you can get an understanding of what's being tested by doing the following on the saved object from your OLS ca

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

2008-07-15 Thread hadley wickham
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 On Tue, Jul 15, 2008 at 2:57 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi group! > > GNU enscript is a free (as in freedom) text file

Re: [R] Supressing printing from a function: ecdf

2008-07-15 Thread Prof Brian Ripley
On Tue, 15 Jul 2008, Patrick Burns wrote: If you do: getAnywhere('summary.ecdf') you will see the 'cat' statement that is doing the printing that is annoying you. It seems to me that a better definition of the function would have an argument called something like 'verbose' that controlled if

Re: [R] Supressing printing from a function: ecdf

2008-07-15 Thread Ivar Herfindal
Hello Since the summary.ecdf function first do a "cat", and then calls summary(knots(object),...) , I guess you will obtain the same result without the printing, by just use the latter part of the summary.ecdf function like this: a <- summary(knots(ecdf(rnorm(100["1st Qu."] Hope this he

[R] Odd behavior of remove command

2008-07-15 Thread Dennis Fisher
Colleagues, I have encountered the following problem using R2.7.0 in Windows (Vista). I want to delete a series of functions before I close an R session. I execute the following commands from a script: FunctionsToDelete <- c("function1", "function2", "function3") for (EachFunction in

Re: [R] long data frame selection error

2008-07-15 Thread jim holtman
Seems to work fine for me. Short version is at the end: > for (i in 4:368){ + assign(paste("V", i, sep=''), 1:10) + } > Temp <- data.frame(V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, + V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27, V28, V29, V30, + V31, V32, V33, V34, V

Re: [R] Function to create variables with prefix

2008-07-15 Thread Uwe Ligges
Example: myfunction <- function(mydata, myvariables, prefix="norm_"){ newnames <- paste(prefix, myvariables, sep="") mydata[newnames] <- scale(mydata[myvariables]) mydata } mydata <- data.frame(a=1:2, b=3:2) myfunction(mydata, c("a", "b")) Moira Burke wrote: Hi. I'm a

Re: [R] Supressing printing from a function: ecdf

2008-07-15 Thread tolga . i . uzuner
Many thanks all for the response, this worked. Hi Martin, the "verbose" recommendation below would be very useful if this could be considered for a future release of stats/ecdf. Regards, Tolga Ivar Herfindal <[EMAIL PROTECTED]> 15/07/2008 10:38 Please respond to [EMAIL PROTECTED] To Patri

Re: [R] modeling binary response variables

2008-07-15 Thread Daniel Malter
thanks Simon Blomberg-4 wrote: > > Jim Lindsey's repeated package has the function gnlmm which will fit > beta regressions with a random intercept and one level of nesting. I > don't know of any other options. > > Cheers, > > Simon. > > Not sure On Mon, 2008-07-14 at 19:16 -0700, Daniel Mal

Re: [R] Assoociative array?

2008-07-15 Thread jim holtman
I am not sure what your data looks like. Do 'str(sc)' to show the structure. I created a set and this is what I got: > x <- list(sc,sc,sc,sc) > x [[1]] DayOfYear Quantity Fraction Category SubCategory 1 1 82 3.903927e-05 (Unknown) (Unknown) 2 2 78 3.713492e-0

[R] tryCatch - return from function to main script

2008-07-15 Thread Anne-Marie Ternes
Dear helpers, I've got a main script, which calls 4 times a function on 4 different datasets respectively. This function runs "nls" and is located in another R script which is sourced into my main script. What I would like to have is this: If, e.g. in the 3rd call of the function, nls fails, bec

[R] Layers in graphs

2008-07-15 Thread Thomas Fröjd
Hi, I am trying to plot a distribution over a histogram with the polygon() function. However I have to use this function after hist() and that makes the polygon cover the histogram. I would prefer having the histogram at the top layer and the polygon as the background. Is that possible? A workaro

Re: [R] Insurance review statistical methods

2008-07-15 Thread Yasir Kaheil
yes R has everything that TRICAST offers.. and much more Kenneth Cabrera-2 wrote: > > Hi R users: > > I will like to know if somebody works on insurance statistics > (actuarial problems) and had use TRICAST, and can tell me > if with all the R tools it can be build a solution > like TRICAST or

Re: [R] Layers in graphs

2008-07-15 Thread René Capell
Hi Thomas, without really knowing how your plot looks like: You could try to redraw the first plot in the same device, i.e.: #graph it hist(weights$Weight, freq=TRUE, breaks=breakpoints, main=wfiles[i]) #lines(dens) polygon(dens$x, dens$y, border=NA, col=rgb(1,0,1,0.5)) #direct into open device p

[R] linear and non linear regression in 3D !

2008-07-15 Thread Param Priya Singh
Hi All, I have to draw a best fit line in a helix that will tell the axis of the helix and a curve that will tell the curvature of the helix. I suppose I have to do linear and non linear regression in 3D space for this ? I have coordinates in following structure 'data.frame': 24 obs. of 3

[R] Mapping data onto 1-10 score

2008-07-15 Thread rcoder
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. I would be grateful for suggestions on how best to do this. Thanks, rcoder -- View this message in context: http://ww

Re: [R] Layers in graphs

2008-07-15 Thread Thomas Fröjd
Thank you! Works perfectly. On Tue, Jul 15, 2008 at 1:31 PM, René Capell <[EMAIL PROTECTED]> wrote: > Hi Thomas, > without really knowing how your plot looks like: You could try to redraw the > first plot in the same device, i.e.: > > #graph it > hist(weights$Weight, freq=TRUE, breaks=breakpoint

Re: [R] Assoociative array?

2008-07-15 Thread rkevinburton
Sure. I have the following command: sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE) where x is x <- read.csv("Sales2007.dat", header=TRUE) and the first few rows are: DayOfYear,Quantity,Fraction,Category,SubCategory 1,82,0.390392720794458,"(Unknown)","(Unknown)" 2,78,0.3713

[R] Mapping data onto score

2008-07-15 Thread rcoder
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. I would be grateful for suggestions on how best to do this. Thanks, rcoder -- View this message in context: http://ww

[R] playwith package crashes on Mac

2008-07-15 Thread Michael Kubovy
Dear R-helpers, I tried the playwith packages for the first time, and it crashed R: > require(playwith) Loading required package: playwith Loading required package: lattice Loading required package: grid Loading required package: gWidgets Loading required package: gWidgetsRGtk2 Loading required

Re: [R] Assoociative array?

2008-07-15 Thread rkevinburton
It seems the R console took them out. Here is hat I tried: > for(i in 1:length(sc)) + { + sum(sc[[i]]]$Quantity) Error: unexpected ']' in: "{ sum(sc[[i]]]" > } Error: unexpected '}' in "}" > > > What I entered is in the sum that is after the '+' Thank you. Kevin jim holtman <[E

Re: [R] creating axis of the plot before data are plotted -- solved

2008-07-15 Thread Zroutik Zroutik
Solved. I tried to create a minimal example, but my script is too complicated to just cut out lines (too many dependencies). Instead of it, I sketch my idea. I do not say it is the nicest solution, but it works as I wanted. The first five rows of my data-matrix: > data_svd$u[1:5,]

[R] Exporting an list()

2008-07-15 Thread Leandro Marino
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 197.23 50.65 88.16 120.46 136.62 159.33 4980 12.60 170.90 38.34 86.98

Re: [R] Assoociative array?

2008-07-15 Thread rkevinburton
I think I had an extra '[', ']'. My mistake on this one. Thank you. Kevin [EMAIL PROTECTED] wrote: > With my data I get > > sc[["(Unknown).{Unknown)"]] > > returns NULL > > but sc[[1]] returns > > DayOfYear Quantity Fraction Category SubCategory > 1 1 82 3.9039

[R] manipulating (extracting) data from distance matrices

2008-07-15 Thread Michael Rennie
Hi all, Does anyone have any tips for extracting chunks of data from a distance matrix? For instance, if one was interested in only a subset of distance comparisons (i.e., that of rows 4 thru 6, and no others), is there a simple way to pull that data out? >From some playing around with an exampl

Re: [R] Exporting an list()

2008-07-15 Thread Henrique Dallazuanna
Maybe you can use the dput: x <- list(VAR1 = data.frame(x=rnorm(10), y=rnorm(10)), VAR2 = data.frame(x=rnorm(10), y=rnorm(10))) dput(x, file='list.txt') x <- source('list.txt')[[1]] On Tue, Jul 15, 2008 at 10:10 AM, Leandro Marino <[EMAIL PROTECTED]> wrote: > Hi, > > I have an list() l

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

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] 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] 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] 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,

[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] 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] 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] 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"

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

[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

[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] 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

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

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

[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] 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

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] 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] 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 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] 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] 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 - +

[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

[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

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] 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] 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] 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] 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

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] 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] 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] 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] 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] 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

[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
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

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] 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] 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

[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] 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 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

[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

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 >

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

[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

[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

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

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] 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] 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] 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

[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] .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] 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] 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

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 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] 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

[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] 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

  1   2   >