[R] Fwd: Decision Stats

2008-10-25 Thread Ajay ohri
Dear Lists, Here are my latest posts on retrenching and locating facilities better. Do you have anything in academic papers that use data mining- analytics for 1) Better Employee ROI quantitative measurement or cutting costs rationally based on data rather across the board. 2) Locating facilities

Re: [R] help: selection of data

2008-10-25 Thread Martin Ballaschk
Hi Jim. jim holtman schrieb: > If you only want the first sequence, Yes, that's true, I forgot to say that! >> x <- c(-10, -5, 0, 5, 10, 15, 20) >> y <- c(10, 10, 10, -5, -6, -7, 10) >> data <- as.matrix( cbind(x, y) ) >> # if you only want the first 'run', then use 'rle' to find it >> mask <-

Re: [R] Transferring results from R to MS Word2

2008-10-25 Thread Felipe Carrillo
Tom: Supposse your Excel file is named "myExcelFile" Open myExcelFile and SaveAs "myExcelFile.csv" or "myExcelFile.txt" Then go to the RConsole and type: #Option # 1 mydata <- read.csv("PathTomyExcelFile.csv",header=T) mydata # You should be able to see your dataset in R # Option # 2 # If you s

Re: [R] Transferring results from R to MS Word

2008-10-25 Thread Liviu Andronic
On Sat, Oct 25, 2008 at 9:05 PM, Tom Backer Johnsen <[EMAIL PROTECTED]> wrote: >> I am a new user of R. My problem is how to read excel data files. >> How can I read a file called stock in R. What statement I should use? > It could help to start learning R with a GUI like Rcmdr. Among other feature

[R] Starting value for lme()

2008-10-25 Thread umlih2
Hi All, * I want to use the same starting values as used in LME() to compare another estimation method for linear mixed effects models. Could you please let me know how should I extract or output starting values used by LME() or is there any separate program I can use for this pu

Re: [R] map points from scatterplot3d onto 2d fitted plane

2008-10-25 Thread Uwe Ligges
Jacqueline Hall wrote: Dear R helpers, I have a 3D scatter plot that I have generated from scatterplot3d (which looks great- thanks!) and I can see that the points in my graph fall in a plane. Following the example 5 from 3D scatter plot (below) I have fitted a regression plane. Now what I wou

[R] Docbook equivalent of Sweave

2008-10-25 Thread Sean Davis
I have been looking a bit at docbook as an alternative to latex. However, Sweave is a very nice way to deal with documents mixing R code, figures, and text as well as markup. I saw a couple of references in the email archives that people have been experimenting with combinations of tools (includin

Re: [R] Transferring results from R to MS Word

2008-10-25 Thread Tom Backer Johnsen
Jasim Al-Ajmi wrote: Dear Tom I am a new user of R. My problem is how to read excel data files. How can I read a file called stock in R. What statement I should use? Thanks for your help. Thye simplest is to save your file as a .CSV file. This is a "plain text" file where the elements are sepa

Re: [R] Repetitive correlation test

2008-10-25 Thread Amarjit Singh Sethi
Dear Burns Replacing comma through tilde has not helped; I got the message: Error in cor.test.formula(frm, alternative = "two.sided", method = "pearson") : 'formula' missing or invalid. As you know, the syntax for test for corelation coefficient b/w variables x1 & x2 is as: cor=cor.test(x1,x2

Re: [R] create group variable -- family data -- for siblings

2008-10-25 Thread Gabor Grothendieck
Correction and shortening: f <- function(i) { i1 <- if (is.na(famdat[i, 2])) i else match(famdat[i, 2], famdat[1:i, 2]) i2 <- if (is.na(famdat[i, 3])) i else match(famdat[i, 3], famdat[1:i, 3]) min(i1, i2) } as.numeric(factor(sapply(1:nrow(famdat), f))) On Sat, Oct 25, 2008 at 1:28 PM, Gab

Re: [R] help: selection of data

2008-10-25 Thread jim holtman
If you only want the first sequence, then this might work: > x <- c(-10, -5, 0, 5, 10, 15, 20) > y <- c(10, 10, 10, -5, -6, -7, 10) > data <- as.matrix( cbind(x, y) ) > # if you only want the first 'run', then use 'rle' to find it > mask <- data[,1] > 0 & data[,2] > min(data[,2]) > run <- rle(mask

Re: [R] create group variable -- family data -- for siblings

2008-10-25 Thread Gabor Grothendieck
Here is one other solution. For each row it finds the earliest row that has the same momid or popid: f <- function(i) { if (is.na(famdat[i, 1]) || is.na(famdat[i, 2])) { i } else { i1 <- match(famdat[i, 1], famdat[1:i, 1]) i2 <- match(famdat[i, 2], famdat[1:i, 2]

Re: [R] Filling symbols in xyplot

2008-10-25 Thread baptiste auguie
Hi, I feel that your example isn't exactly minimal so I may be completely overlooking your question. Would the following do? library(lattice) mdf <- data.frame(x <- seq(0, pi, l=100), y=sin(x)) xyplot(y~x, data=mdf, type="b", par.settings=list(plot.symbol=list(pch=21, col="r

Re: [R] rproxy.dll

2008-10-25 Thread Duncan Murdoch
On 25/10/2008 1:01 PM, Murray Eisenberg wrote: Is rproxy.dll supposed to be installed as part of a Windows binary installation of R? And the installer put it in R's bin subdirectory? If so, it seems to be missing from the R-2.8.0 patched, 2008-10-25 (r46779), that I installed. See the CHA

Re: [R] help: selection of data

2008-10-25 Thread stephen sefick
#is this what you want? x <- c(-10, -5, 0, 5, 10, 15, 20) y <- c(10, 10, 10, -5, -6, -7, 10) data <- data.frame(x, y) subset(data, x>0 & y==min(y)) On Sat, Oct 25, 2008 at 12:33 PM, Martin Ballaschk <[EMAIL PROTECTED]> wrote: > Hi, > > I'm not very experienced with R and struggle with data selecti

[R] rproxy.dll

2008-10-25 Thread Murray Eisenberg
Is rproxy.dll supposed to be installed as part of a Windows binary installation of R? And the installer put it in R's bin subdirectory? If so, it seems to be missing from the R-2.8.0 patched, 2008-10-25 (r46779), that I installed. -- Murray Eisenberg [EMAIL PROTECTED] Mat

Re: [R] how to plot chi-square distribution in the graph

2008-10-25 Thread David Winsemius
On Oct 24, 2008, at 11:22 PM, leo_wa wrote: if i want to plot the chi-square distribution with a different degree of freedom how can i plot it in the graph?Sometimes i plot the histogram and cut it in a lot of piece.It's distribution like a chi-square.So i want to plot the chi-square wi

Re: [R] create group variable -- family data -- for siblings

2008-10-25 Thread Gabor Grothendieck
Create a distance metric which is 0 if there are common mothers or fathers and 1 otherwise using that to cluster your points: dd <- with(famdat, outer(momid, momid, "!=") * outer(dadid, dadid, "!=")) dd[is.na(dd)] <- 1 hc <- hclust(as.dist(dd)) cutree(hc, h = 0.1) On Sat, Oct 25, 2008 at 11:08 AM

[R] help: selection of data

2008-10-25 Thread Martin Ballaschk
Hi, I'm not very experienced with R and struggle with data selection from a long matrix with two columns. I want to cut out the data between x > 0 and min(y). > x <- c(-10, -5, 0, 5, 10, 15, 20) > y <- c(10, 10, 10, -5, -6, -7, 10) > data <- as.matrix( cbind(x, y) ) > data x y [1,] -10

[R] create group variable -- family data -- for siblings

2008-10-25 Thread Juliet Hannah
For the following data: famdat <- read.table(textConnection("ind momid dadid 1 1819 2 1819 3 1819 4 2122 5 2122 6 2325 7 2327 8 2930 9 3130 10 4041 11 NANA 12 5051"),header=TRUE) closeAllConnections(); I would like to create a l

[R] Filling symbols in xyplot

2008-10-25 Thread John Poulsen
Hello, I am using xyplot and am happy with my graph, *except* that I cannot get the symbols to be filled. I tried using bg=c("red3","red","black","lightgrey")) in both the key and the xyplot function, that that was obviously not the answer. I would like the sybols to be filled with the same

Re: [R] Problem with error handling inside a function

2008-10-25 Thread Gabor Grothendieck
Try this: evaluate.all <- function(response, DF = iris) { DF <- cbind(response = DF[[response]], DF) L <- list( # some linear models: B1 = try(lm(response ~ Sepal.Length, DF)), L2 = try(lm(response ~ Sepal.Width, DF)), # s

Re: [R] Transferring results from R to MS Word

2008-10-25 Thread Tom Backer Johnsen
Frank E Harrell Jr wrote: Tom Backer Johnsen wrote: Greg Snow wrote: You may want to try the odfWeave package. It uses openoffice which can read and write MSWord documents. This is an alternative to the HTML > Excel > Word route. Now that is an interesting alternative. Not for this term t

[R] Problem with error handling inside a function

2008-10-25 Thread Dr. Christoph Scherber
Dear R users, I have written a function that runs several statistical models and extracts the AIC values from them. As a (nonsense) example, I use the iris dataset: # data(iris) attach(iris) evaluate.all=function(response,...){ response=get(response) #retrieves the response variab

Re: [R] Transferring results from R to MS Word

2008-10-25 Thread Frank E Harrell Jr
Tom Backer Johnsen wrote: Greg Snow wrote: You may want to try the odfWeave package. It uses openoffice which can read and write MSWord documents. This is an alternative to the HTML > Excel > Word route. Now that is an interesting alternative. Not for this term though, to get the students

[R] Methods for showing statistics over space

2008-10-25 Thread Werner Wernersen
Hi, I have a question which is a little off-topic but then again, it should stay in the boundaries of what can be done with available R functions. Has anyone pointers to tutorials or the like where one can get inspiration on how to visualize some "spatial" statistics? I want to analyze differen

Re: [R] Barplot Labels Problem

2008-10-25 Thread Jim Lemon
Rodrigo Aluizio wrote: Hi everybody, well I'm trying to use barplot for the first time. I get a suitable graphic but I'm having a weird problem. My graphic is generated from a matrix with several species (rowNames) and two abundance columns. So each species will have two bars, and the species n

Re: [R] Computational problems in R

2008-10-25 Thread Duncan Murdoch
On 24/10/2008 9:50 PM, Steven McKinney wrote: I suspect there's a deeper issue here. sum(exp(yi)) when large yi occur is problematic. exp(yi) for yi>710 is just a huge number, and summing additional values only makes the overall sum larger as all components of the summation are positive. There's

Re: [R] Error Running TinnR with R

2008-10-25 Thread Yihui Xie
Currently there are some problems with the building of Hmisc binary package; see CRAN for more information. My suggestion is you can remove (or comment out) the code lines not to use Hmisc for Tinn-R until it's available again on CRAN. As for me, I merely use two expressions in Rprofile.site and I

Re: [R] Transferring results from R to MS Word

2008-10-25 Thread Tom Backer Johnsen
Greg Snow wrote: You may want to try the odfWeave package. It uses openoffice which can read and write MSWord documents. This is an alternative to the HTML > Excel > Word route. Now that is an interesting alternative. Not for this term though, to get the students to learn R and at the sam