Re: [R] Lattice key title color and trellis par settings

2008-10-16 Thread Meesters, Erik
Thank you all! This is a great course on Lattice par settings (though not answering the question)! And a truly must have: Lattice: Multivariate Data Visualization with R (Use R). Thank you Dr. Sarkar! Here's it all summed up. #Looking at lattice par settings: library(lattice) str(trellis.par.get

Re: [R] histogram without bars but with density line - frequency-lines?

2008-10-16 Thread Yihui Xie
Bars are corresponding to bins, and the bin-width for lines is 0; please tell me what is the "frequency" at a fixed point (rather than over an interval)? Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.y

[R] R plot

2008-10-16 Thread Haoda Fu
All - When I plot something like a<-rnorm(5) b<-rnorm(5) plot(a,b,col = "red") points(10,-10) The last point is missing because it is out of range of the first plot. I just try to switch from Matlab to R. In Matlab, it always can automatic adjust the xlim and ylim for such case. Is it possi

Re: [R] Saving results of Kruskal Walis test

2008-10-16 Thread Jorge Ivan Velez
Dear Himanshu, Try ?sink() : data_file.out <- krukal.test(data_file) sink("~/DATA/results/data_file_out.txt") data_file.out sink() HTH, Jorge On Thu, Oct 16, 2008 at 4:31 PM, Himanshu Ardawatia <[EMAIL PROTECTED]>wrote: > Hello, > > I am running Kruskal-Walis test in R. When I try to save r

Re: [R] Saving results of Kruskal Walis test

2008-10-16 Thread Bernardo Rangel Tura
Em Qui, 2008-10-16 às 22:31 +0200, Himanshu Ardawatia escreveu: > Hello, > > I am running Kruskal-Walis test in R. When I try to save results using > write.table it gives me the following error : > > Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = > stringsAsFactors) :

Re: [R] padding "bug" in lattice/levelplot

2008-10-16 Thread Deepayan Sarkar
On 10/16/08, Paul Boutros <[EMAIL PROTECTED]> wrote: > Hello, > > I have encountered some unexpected behaviour with levelplot that may simply > be a misunderstanding on my part. > > If I create a levelplot from a matrix with named columns, some "padding" > space appears at the top and bottom of t

[R] padding "bug" in lattice/levelplot

2008-10-16 Thread Paul Boutros
Hello, I have encountered some unexpected behaviour with levelplot that may simply be a misunderstanding on my part. If I create a levelplot from a matrix with named columns, some "padding" space appears at the top and bottom of the heatmap. Here is an example, and I've used panel.fill t

Re: [R] Suppressing error messages in a for loop

2008-10-16 Thread jim holtman
?try On Thu, Oct 16, 2008 at 4:46 PM, hgreatrex <[EMAIL PROTECTED]> wrote: > > Hi, > > Is there any way that I can supress error messages so that they don't stop > for loops running? > > I'm using the gstat package and have created a variogram model for the > double exponential model: > >"dexp

[R] Suppressing error messages in a for loop

2008-10-16 Thread hgreatrex
Hi, Is there any way that I can supress error messages so that they don't stop for loops running? I'm using the gstat package and have created a variogram model for the double exponential model: "dexp <- vgm( .5, "Exp", 10,.1, add.to = vgm(.5, "Exp", 100))" and fitted it using "dexp

Re: [R] R: "in-place" appending to a matrix.

2008-10-16 Thread Erik Iverson
repkakala Gazeta.pl wrote: Rigth, sorry. R is great for many usages even when it did not got modernised as many realy modern languages did. This is a nice read if you have some time about some possibly surprising truths about 'modern' languages. http://www.paulgraham.com/icad.html

Re: [R] R: "in-place" appending to a matrix.

2008-10-16 Thread repkakala Gazeta.pl
Rigth, sorry. R is great for many usages even when it did not got modernised as many realy modern languages did. Appologies for developers, I were too rude. \misiek 2008/10/16 <[EMAIL PROTECTED]> > > that's extremely rude , especially to all the people who made and make R > what it is. If you

[R] How to constrain the residual variance to be 0 in linear mixed-effects models?

2008-10-16 Thread Wen Luo
Hi everyone, How to constrain the residual variance to be 0 when using the lmer function? Wen Luo Wen Luo, Ph.D. Assistant Professor Department of Educational Psychology University of Wisconsin -- Milwaukee Enderis Hall 759 P.O. Box 413 Milwaukee, WI 53201-0413 Office: 414 229 4998 Fax: 414 229

Re: [R] MLE Constraints

2008-10-16 Thread LFRC
Dears, Any help? Thanks, LFRC LFRC wrote: > > Dears, > > I'm trying to find the parameters (a,b, ... l) that optimize the function > (Model) > described below. > > 1) How can I set some constraints with MLE2 function? I want to set p1>0, > p2>0, > p3>0, p1>p3. > > 2) The code is giving

Re: [R] R: "in-place" appending to a matrix.

2008-10-16 Thread markleeds
that's extremely rude , especially to all the people who made and make R what it is. If you don't like R, noone is forcing you to use it. On Thu, Oct 16, 2008 at 5:50 PM, repkakala Gazeta.pl wrote: On 10/16/2008 10:50 AM, culpritNr1 wrote: Now, modern high level languages like the cont

Re: [R] R: "in-place" appending to a matrix.

2008-10-16 Thread repkakala Gazeta.pl
On 10/16/2008 10:50 AM, culpritNr1 wrote: > >> >> Now, modern high level languages like the continually improving R, > > " References: Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S Language_. Wadsworth & Brooks/Cole. " This is most important reference in many help pa

Re: [R] Roman numeral question

2008-10-16 Thread Barry Rowlingson
2008/10/16 Erin Hodgess <[EMAIL PROTECTED]>: > Hi R People! > > Is there a setup for Roman numerals similar to that of LETTERS and > letters, please? > > I was putting together a randomized block design and thought that it > might be nice for factors. > > Thanks, > Erin > as.roman() in utils: >

[R] Roman numeral question

2008-10-16 Thread Erin Hodgess
Hi R People! Is there a setup for Roman numerals similar to that of LETTERS and letters, please? I was putting together a randomized block design and thought that it might be nice for factors. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences Un

Re: [R] stablefit can fit the parameters of a truncated normal distribution?

2008-10-16 Thread John C Frain
This idea is very wrong, Have a look at the function cnormal1 in the VGAM package John frain 2008/10/15 drbn <[EMAIL PROTECTED]>: > > I'm using stableFit from the package fBasics to estimate the parameters of a > truncated normal distribution (I'm interested in the parameters of the > underlying

Re: [R] gWidgets install

2008-10-16 Thread Michael Lawrence
On Tue, Oct 14, 2008 at 7:15 PM, john verzani <[EMAIL PROTECTED]> wrote: > Tim Smith yahoo.com> writes: > > > > > Thanks Charlie - I just tried it, but still get the same error: > > > > --- > > > install.packages("gWidgets",dependencies=TRUE) > > ... > > > > library(gW

Re: [R] Statistical courses

2008-10-16 Thread Erin Hodgess
XLSolutions-corp has 2 day training courses; one for beginners and one for advanced. Here is the website: www.xlsolutions-corp.com Hope this helps! Sincerely, Erin On Thu, Oct 16, 2008 at 1:50 AM, timpanister <[EMAIL PROTECTED]> wrote: > Hi, > > Can anyone suggest some short term statistical c

[R] bivariate uniform density estimation

2008-10-16 Thread Lavan
Dear R users, I have two uniform random variables and I need to estimate the joint density. I like to know whether there is any package which estimates bivariate uniform densities. Thanks, Lavan -- View this message in context: http://www.nabble.com/bivariate-uniform-density-estimation-tp2

Re: [R] Loop avoidance in simulating a vector

2008-10-16 Thread Ray Brownrigg
If you want to avoid using a loop, rather than coding a loop, then someting like: DV <- rnorm(sum(n)) DV <- DV * rep(sigma, times=n) + rep(mu, times=n) will achieve the same as the loop you specified, but generalised to non-constant n. HTH Ray Brownrigg On Fri, 17 Oct 2008, Bert Gunter wrote:

[R] Saving results of Kruskal Walis test

2008-10-16 Thread Himanshu Ardawatia
Hello, I am running Kruskal-Walis test in R. When I try to save results using write.table it gives me the following error : Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class "htest" into a data.frame The overall code is as follow

Re: [R] Loop avoidance in simulating a vector

2008-10-16 Thread Christos Hatzis
Yes, but the difference is that the looping in mapply is done in C. There are no interpreted loops in mapply,as far as I can see. -Christos > -Original Message- > From: Bert Gunter [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 16, 2008 4:13 PM > To: [EMAIL PROTECTED]; 'David Afsha

Re: [R] Loop avoidance in simulating a vector

2008-10-16 Thread Bert Gunter
mapply is still a (disguised) loop (at the interpreted level). So other than improving code readability (always a good thing!), it shouldn't make much of an efficiency difference. A longer answer is: if all you're doing is a location-scale family of distributions, then creating a matrix of standar

Re: [R] Loop avoidance in simulating a vector

2008-10-16 Thread Christos Hatzis
Have a look at mapply. -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of David Afshartous > Sent: Thursday, October 16, 2008 3:47 PM > To: r-help@r-project.org > Subject: [R] Loop avoidance in simulating a vector > > > > All, > > I'd

[R] Loop avoidance in simulating a vector

2008-10-16 Thread David Afshartous
All, I'd like to simulate a vector that is formed from many distinct distributions and avoid a loop if possible. E.g, consider: mu = c(1, 2, 3) sigma = c(1, 2, 3) n = c(10, 10, 10) And we simulate a vector of length 30 that consists of N(mu[i], sigma[i]) distributed data, each of length n[i]

Re: [R] defining a function using strings

2008-10-16 Thread Gabor Grothendieck
Try this (to evaluate them at 10): polynomial.values(l, 10) On Thu, Oct 16, 2008 at 2:40 PM, Chernomoretz Ariel <[EMAIL PROTECTED]> wrote: > Hi All, > I need to evaluate a series expansion using Legendre polynomials. > Using the 'orthopolinom' package I can get a list of the first n > Legendre p

Re: [R] defining a function using strings

2008-10-16 Thread Dimitris Rizopoulos
try this: library(orthopolynom) l <- legendre.polynomials(4) fun.l <- lapply(l, as.function) fun.l[[3]](1:3) I hope it helps. Best, Dimitris Chernomoretz Ariel wrote: Hi All, I need to evaluate a series expansion using Legendre polynomials. Using the 'orthopolinom' package I can get a list

Re: [R] Variable shortlisting for the logistic regression

2008-10-16 Thread Rolf Turner
On 17/10/2008, at 8:22 AM, useR wrote: Let's try to bring this discussion back again after Frank made very funny remark! Frank's remark was *serious*. Take it seriously. cheers, Rolf Turner ###

Re: [R] defining a function using strings

2008-10-16 Thread Rolf Turner
On 17/10/2008, at 7:40 AM, Chernomoretz Ariel wrote: Hi All, I need to evaluate a series expansion using Legendre polynomials. Using the 'orthopolinom' package I can get a list of the first n Legendre polynomials as character strings. library(orthopolynom) l<-legendre.polynomials(4) l [[1]]

Re: [R] Variable shortlisting for the logistic regression

2008-10-16 Thread useR
Let's try to bring this discussion back again after Frank made very funny remark! What I'm doing at the moment is: 1. I split dataset in two (development and holdout) 2. I fit single predictor logistic model for every variable and collect following stats: DMaxDeriv=modelD$stats[2] DModelLR=m

[R] defining a function using strings

2008-10-16 Thread Chernomoretz Ariel
Hi All, I need to evaluate a series expansion using Legendre polynomials. Using the 'orthopolinom' package I can get a list of the first n Legendre polynomials as character strings. > library(orthopolynom) > l<-legendre.polynomials(4) > l [[1]] 1 [[2]] x [[3]] -0.5 + 1.5*x^2 [[4]] -1.5*x + 2.5*

Re: [R] package Utils Sweave Example Error

2008-10-16 Thread Prof Brian Ripley
On Thu, 16 Oct 2008, Duncan Murdoch wrote: On 10/16/2008 12:19 PM, Felipe Carrillo wrote: This is my sessionInfo() and Sys.getenv("PATH") library(tools) testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils") ## enforce par(ask=FALSE) options(device.ask.default=FALSE) ## cre

Re: [R] Programing and writing function help

2008-10-16 Thread Stephen Cole
Thank- you all for you suggestions and help. I have now resolved my issue. This help forum is one of the things that makes R a great platform for statistics. Stephen Cole Marine Ecology Lab Saint Francis Xavier University On Wed, Oct 8, 2008 at 8:07 AM, Erin Hodgess <[EMAIL PROTECTED]>wrote:

[R] Sweave working now!!!

2008-10-16 Thread Felipe Carrillo
Duncan: I installed R in C:\R\R-2.7.2 and worked beautifully. I hope this will help others with the same problem. Thanks a lot for your help. --- On Thu, 10/16/08, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 10/16/2008 12:19 PM, Felipe Carrillo wrote: > > This is my sessionInfo() and > Sys.

Re: [R] plot - central limit theorem

2008-10-16 Thread Duncan Murdoch
On 10/16/2008 11:43 AM, Greg Snow wrote: I wonder if including the p-values for the normality test is the best approach in you animation? The clt does not say that the distribution of the means will be normal, just that it approaches normality (and therefore may be a decent approximation). Th

Re: [R] package Utils Sweave Example Error

2008-10-16 Thread Duncan Murdoch
On 10/16/2008 12:19 PM, Felipe Carrillo wrote: This is my sessionInfo() and Sys.getenv("PATH") library(tools) testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils") ## enforce par(ask=FALSE) options(device.ask.default=FALSE) ## create a LaTeX file Sweave(testfile) Writing t

Re: [R] counting the frequencies of a vector

2008-10-16 Thread David Winsemius
On Oct 16, 2008, at 12:55 PM, Jorge Ivan Velez wrote: Dear Jörg, See ?cut and ?table. Is this what you want? x <- c(1, 3, 1.2, 5, 5.9) table(cut(x,breaks=c(0,2,4,6))) (0,2] (2,4] (4,6] 2 1 2 Perhaps even greater future efficiency could be had by also adding ?seq table(cut(x, bre

Re: [R] plot - central limit theorem *solved*

2008-10-16 Thread Jörg Groß
Thanks for your great help! I have now what I wanted. For sure it's not well written and you can realize it with much less lines. But it works and it's like how I wanted it to look like; z1 <- rnorm(4500, mean=20, sd=5) z2 <- rnorm(3600, mean=28, sd=5) z3 <- rnorm(1300, mean=40, sd=7) z4 <

Re: [R] How to save/load RWeka models into/from a file?

2008-10-16 Thread Achim Zeileis
On Thu, 16 Oct 2008, Paulo Cortez wrote: Hi, I want to save a RWeka model into a file, in order to retrive it latter with a load function. See this example: library(RWeka) NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayes") model<-NB(formula,data=data,...) # does not run but yo

[R] How to save/load RWeka models into/from a file?

2008-10-16 Thread Paulo Cortez
Hi, I want to save a RWeka model into a file, in order to retrive it latter with a load function. See this example: library(RWeka) NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayes") model<-NB(formula,data=data,...) # does not run but you get the idea save(model,file="model.dat"

[R] rpart display

2008-10-16 Thread Sharma, Dhruv
Hi, is there a way to replace long splits with some short naming conventions? For example if my resulting tree from rpart has 50-100 values can I display some summary text like group1 instead of group num = 1 or 2 or 3100? is there a way to specify different display text for nod

Re: [R] increase memory limit in R

2008-10-16 Thread Prof Brian Ripley
AFAICS, you have a 2GB address space: please do read the rw-FAQ and fix that, in which case R will automatically make use of the increased space. Hint: what is /3GB for? On Thu, 16 Oct 2008, liujb wrote: Dear R users, I am running lmer() and having memory problem: "reached total allocation

Re: [R] Grouped Histogram (colored)

2008-10-16 Thread Greg Snow
Does this do what you want? colhist <- function(x,col){ tmp <- hist(x,plot=F) br <- tmp$breaks w <- as.numeric(cut(x,br,include.lowest=TRUE)) sy <- unlist(lapply(tmp$counts,function(x)seq(length=x))) sy <- sy[order(order(x))] plot( range(br)

Re: [R] Grouped Histogram (colored)

2008-10-16 Thread hadley wickham
On Thu, Oct 16, 2008 at 11:42 AM, x0rr0x <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm trying to create a histogram which shows the frequency of variables > within a certain timeframe. > > I've been using SPSS before, but I didn't quite like it... > > To describe my problem further here are some e

Re: [R] draw a 5cm x 3cm rectangle

2008-10-16 Thread Erik Iverson
I would personally use grid for this. library(grid) grid.rect(width = 5, height = 3, default.units = "cm") Barry Rowlingson wrote: 2008/10/16 Thomas Steiner <[EMAIL PROTECTED]>: Hi I want to draw sth in a pdf file with a predefined defined size. Say a 5cm x 3cm rectangle (a ruler): pdf("rect

[R] increase memory limit in R

2008-10-16 Thread liujb
Dear R users, I am running lmer() and having memory problem: "reached total allocation of 1535Mb". The lmer() function was successful (no errors or warnings). However when I do "summary(fit.lmer), I got this "Error: cannot allocate vector of size 19.5 Mb). I used memory.size() and got 1880. I us

Re: [R] counting the frequencies of a vector

2008-10-16 Thread Jorge Ivan Velez
Dear Jörg, See ?cut and ?table. Is this what you want? x <- c(1, 3, 1.2, 5, 5.9) table(cut(x,breaks=c(0,2,4,6))) (0,2] (2,4] (4,6] 2 1 2 HTH, Jorge On Thu, Oct 16, 2008 at 12:46 PM, Jörg Groß <[EMAIL PROTECTED]> wrote: > Hi, > > > Is there a function which counts the frequencies o

Re: [R] counting the frequencies of a vector

2008-10-16 Thread Greg Snow
?cut or ?findInterval and ?table -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] 801.408.8111 > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > project.org] On Behalf Of Jörg Groß > Sent: Thursday, October 16, 20

[R] Grouped Histogram (colored)

2008-10-16 Thread x0rr0x
Hi all, I'm trying to create a histogram which shows the frequency of variables within a certain timeframe. I've been using SPSS before, but I didn't quite like it... To describe my problem further here are some example variables: the "event" is actually a string which I recoded using: [code]

Re: [R] counting the frequencies of a vector

2008-10-16 Thread Barry Rowlingson
2008/10/16 Jörg Groß <[EMAIL PROTECTED]>: > Hi, > > > Is there a function which counts the frequencies of the occurence of a > number within an interval? > > for example I have this vector: > > x <- c(1, 3, 1.2, 5, 5.9) > > and I want a vector that gives me the frequencies within an interval of 2,

Re: [R] draw a 5cm x 3cm rectangle

2008-10-16 Thread Greg Snow
Add to that list the functions grconvertX and grconvertY which can take coordinates in many different units and convert them to others (including inches, then just multiply/divide by 2.54 for the conversion from/to cm). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Health

[R] counting the frequencies of a vector

2008-10-16 Thread Jörg Groß
Hi, Is there a function which counts the frequencies of the occurence of a number within an interval? for example I have this vector: x <- c(1, 3, 1.2, 5, 5.9) and I want a vector that gives me the frequencies within an interval of 2, beginning at 0 (so the intervals are 0-2, 2-4, 4-6 a

Re: [R] correlation between a discrete variable and a continuous variable

2008-10-16 Thread Greg Snow
Since water quality is ordered, you could use cor.test with method of kendall or spearman. This will basically give a test of whether the rank based correlation is significantly different from 0. Often more interesting information can come from the data if you do some more work. Start by grap

Re: [R] draw a 5cm x 3cm rectangle

2008-10-16 Thread Barry Rowlingson
2008/10/16 Thomas Steiner <[EMAIL PROTECTED]>: > Hi I want to draw sth in a pdf file with a predefined defined size. > Say a 5cm x 3cm rectangle (a ruler): > > pdf("rect.pdf", paper="a4") > plot(c(1,5,5,1,1),c(1,1,3,3,1),asp=1,axes="n") > dev.off() > > but how do I fix that one unit is 1cm? I jus

Re: [R] apply, t-test and p-values PREVIOUS SUGGESTION DID NOT WORK

2008-10-16 Thread Jorge Ivan Velez
Dear John, Perhaps is possible to do the job using apply or any of its friends. For now, here is a solution using for() : # Data sets set.seed(123) sample1<-matrix(data=c(1:20),byrow=TRUE,ncol=5,nrow=4) sample2<-sample1+rnorm(20) # t-test p-values k=nrow(sample1) res=NULL for(i in 1:k) res[i]=t.t

Re: [R] package Utils Sweave Example Error

2008-10-16 Thread Felipe Carrillo
This is my sessionInfo() and Sys.getenv("PATH") library(tools) testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils") ## enforce par(ask=FALSE) options(device.ask.default=FALSE) ## create a LaTeX file Sweave(testfile) Writing to file Sweave-test-1.tex Processing code chunks .

Re: [R] apply, t-test and p-values PREVIOUS SUGGESTION DID NOT WORK

2008-10-16 Thread Gábor Csárdi
How about the following? sapply(1:nrow(sample1), function(x) t.test(sample1[x,], sample2[x,])$p.value) Gabor On Thu, Oct 16, 2008 at 6:07 PM, John Sorkin <[EMAIL PROTECTED]> wrote: > Although I am grateful to Jorge and David for their suggestions, their > solution will not solve my problem as s

Re: [R] One-sample test for p

2008-10-16 Thread Greg Snow
I don't think that your question was bad form, there are some things you can do in the future to make it better form. Your questions was certainly better form than others who just ask for an answer to their homework without even admitting that it is homework. You were confused about some very

Re: [R] apply, t-test and p-values PREVIOUS SUGGESTION DID NOT WORK

2008-10-16 Thread John Sorkin
Although I am grateful to Jorge and David for their suggestions, their solution will not solve my problem as sample2 is not fixed. Let me demonstrate what I want to do: # Define two matricies sample1<-matrix(data=c(1:20),byrow=TRUE,ncol=5,nrow=4) sample2<-sample1+rnorm(20) These are the comput

Re: [R] histogram without bars but with density line - frequency-lines?

2008-10-16 Thread Jörg Groß
Am 16.10.2008 um 17:12 schrieb Yihui Xie: plot(density(x)) Regards, Yihui -- Thanks! Is there also a way to plot the frequency-bars (not the density) as lines instead of bars? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] plot - central limit theorem

2008-10-16 Thread Greg Snow
I wonder if including the p-values for the normality test is the best approach in you animation? The clt does not say that the distribution of the means will be normal, just that it approaches normality (and therefore may be a decent approximation). The normality test can just reject the null

Re: [R] apply, t-test and p-values

2008-10-16 Thread John Sorkin
Jorge, David, Thank you for a brilliant solution to my problem! Thanks John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1

Re: [R] package Utils Sweave Example Error

2008-10-16 Thread Duncan Murdoch
On 10/16/2008 10:18 AM, Felipe Carrillo wrote: Hi: I'm still trying to figure out how use Sweave. Trying the example below I get the error message when texi2dvi is executed. Any ideas about how to make texi2dvi work? Try running it as texi2dvi("Sweave-test-1.tex", pdf=TRUE, quiet=FALSE), an

Re: [R] R: "in-place" appending to a matrix.

2008-10-16 Thread Duncan Murdoch
On 10/16/2008 10:50 AM, culpritNr1 wrote: Hello Gabor, First of all, thanks for your reply. Indeed, your strategy solves the problem of speed=). My question was, however, more of an R design question. Your suggestion of pre-allocating a big and continuous portion of memory is probably the firs

Re: [R] correlation

2008-10-16 Thread hadley wickham
On Thu, Oct 16, 2008 at 8:05 AM, kdebusk <[EMAIL PROTECTED]> wrote: > What test do I use to determine if there is a correlation between a > discrete variable and a continuous variable? > > For example - I have water quality ratings for streams (excellent, > good, fair, poor) and a corresponding nit

[R] draw a 5cm x 3cm rectangle

2008-10-16 Thread Thomas Steiner
Hi I want to draw sth in a pdf file with a predefined defined size. Say a 5cm x 3cm rectangle (a ruler): pdf("rect.pdf", paper="a4") plot(c(1,5,5,1,1),c(1,1,3,3,1),asp=1,axes="n") dev.off() but how do I fix that one unit is 1cm? Thanks thomas __ R-help

Re: [R] saving result of a "for" loop

2008-10-16 Thread Alex99
Thanks a lot Stephen. It worked for me. also Jorge had a solution, it's a short and easy code. U could have a look in case U want to use it in future. Thanks again for all your help stephen sefick wrote: > > a <- c(1:10) > b <- c(.5, .6, .9, 10, .4, 3, 4, 9, 0, 11) > d <- c(21:30) > > z <- dat

Re: [R] histogram without bars but with density line

2008-10-16 Thread Yihui Xie
plot(density(x)) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Thu, Oct 16, 20

Re: [R] saving result of a "for" loop

2008-10-16 Thread Alex99
Jorge you are awesome, This code is very efficient. it's exactly what I wanted to do and it's very short and not complicated. Thanks a lot Jorge Ivan Velez wrote: > > Dear Alex, > Is this what you want? > > my=read.table(textConnection(" > X8 X9 X10 X102 X110 X177 X283 X284 X286 X292 X297 X

Re: [R] lmer for two models followed by anova to compare the two models

2008-10-16 Thread Peter Dalgaard
Lawrence Hanser wrote: Dear Colleagues, I run this model: mod1 <- lmer(x~category+subcomp+category*subcomp+(1|id),data=impchiefsrm) obtain this summary result: Linear mixed-effects model fit by REML Formula: x ~ category + subcomp + category * subcomp + (1 | id) Data: impchiefsrm AIC BIC

Re: [R] R: "in-place" appending to a matrix.

2008-10-16 Thread Gabor Grothendieck
The real problem is that running a loop to build up an object bit by bit is not the preferred way to write an R program. The preferred way is to use lapply or other apply command in which case the object gets built for you. On Thu, Oct 16, 2008 at 10:50 AM, culpritNr1 <[EMAIL PROTECTED]> wrote: >

[R] histogram without bars but with density line

2008-10-16 Thread Jörg Groß
Hi, I know how to plot an histogram and how to add a density line. But how can I plot only the density line without the bars? Is there a way to say the hist() function not to plot bars, but a density line instead? __ R-help@r-project.org mailing li

Re: [R] R: "in-place" appending to a matrix.

2008-10-16 Thread culpritNr1
Hello Gabor, First of all, thanks for your reply. Indeed, your strategy solves the problem of speed=). My question was, however, more of an R design question. Your suggestion of pre-allocating a big and continuous portion of memory is probably the first manual work around to try. And it will wo

[R] lmer for two models followed by anova to compare the two models

2008-10-16 Thread Lawrence Hanser
Dear Colleagues, I run this model: mod1 <- lmer(x~category+subcomp+category*subcomp+(1|id),data=impchiefsrm) obtain this summary result: Linear mixed-effects model fit by REML Formula: x ~ category + subcomp + category * subcomp + (1 | id) Data: impchiefsrm AIC BIC logLik MLdeviance REMLdev

[R] package Utils Sweave Example Error

2008-10-16 Thread Felipe Carrillo
Hi: I'm still trying to figure out how use Sweave. Trying the example below I get the error message when texi2dvi is executed. Any ideas about how to make texi2dvi work? library(tools) > testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils") > options(device.ask.default=FAL

Re: [R] apply, t-test and p-values

2008-10-16 Thread Jorge Ivan Velez
Thanks for the correction David! You're absolutely right! A typo :- ) ... Cheers, Jorge On Thu, Oct 16, 2008 at 10:00 AM, David Winsemius <[EMAIL PROTECTED]>wrote: > > On Oct 16, 2008, at 8:11 AM, Jorge Ivan Velez wrote: > > Dear John, >> Yes. Assuming that 'sample2' is fixed, something li

Re: [R] apply, t-test and p-values

2008-10-16 Thread David Winsemius
On Oct 16, 2008, at 8:11 AM, Jorge Ivan Velez wrote: Dear John, Yes. Assuming that 'sample2' is fixed, something like this should do what you want: # Data sets set.seed(123) sample1=matrix(rnorm(100),ncol=10) sample2=rnorm(10,5,4) # t-test p-values apply(X,1,function(x) t.test(x,sample2)$p

Re: [R] saving result of a "for" loop

2008-10-16 Thread Jorge Ivan Velez
Dear Alex, Is this what you want? my=read.table(textConnection(" X8 X9 X10 X102 X110 X177 X283 X284 X286 X292 X297 X306 X308 X314 0 1 000100000000 0 0 001000000010 0 1 0000000

[R] tune function using sigmoid and polynomial kernels

2008-10-16 Thread alexandre lejeune
Hello, When i use tune svm with sigmoid oy polynomial kernels to optimize Cost/gamma/coef0 (sigmoid) or cost/gamma/coef0/degree (polynomial) parameters, i can't get a summary of the best parameters. instead I got this result: dummyparameter 1 0 I use the following command line (7 fo

Re: [R] saving result of a "for" loop

2008-10-16 Thread stephen sefick
a <- c(1:10) b <- c(.5, .6, .9, 10, .4, 3, 4, 9, 0, 11) d <- c(21:30) z <- data.frame(a,b,d) library(fields) results <- c() for(i in 1:(length(rownames(z))-1)){ results[i] <- rdist(z[i,], z[(i+1),]) } results.1 <- data.frame(results) f <- rownames(z) r <- f[-1] rownames(results.1) <- r coln

Re: [R] correlation

2008-10-16 Thread stephen sefick
This may be incorrect, but couldn't you just assign a number to the ratings 1:4 and then scatterplot them agianst N (x-axis). Or you may want to plot boxplots of N by water quality ratings. If these are water quality ratings derived from aquatic macroinvertebrates and you have access to the actua

[R] saving result of a "for" loop

2008-10-16 Thread Alex99
Hi everyone, I have dataset which I take random samples of it 5 times. each time I get the mean for rows for each sample. at the end I need to calculate the Average of all means for each sample and each row. to clear it up I give an example: say this is my dataset. X8 X9X10X12 X13 X14 X15 X1

[R] correlation between a discrete variable and a continuous variable

2008-10-16 Thread kdebusk
What test would you use to determine if a correlation exists between a discrete variable and a continuous variable? For example, I have a rating for stream water quality (excellent, good, fair, poor) and a corresponding nitrogen concentration. I want to see if there is a correlation between the wa

Re: [R] One-sample test for p

2008-10-16 Thread rr400
Thanks for your responses. I know it is bad form asking about these things but i was really having trouble getting my head around it, and i wanted to make sure that the cause wasn't due to the commands i was entering into R. At least now i know it's a conceptual error i am making rather than a tec

Re: [R] Network meta-analysis, varConstPower in nlme - Thank you!

2008-10-16 Thread Christian Gold
Excellent - now it works. Thank you, Christian! (I still seem to be unable to replicate the results as reported in the paper, but that is unrelated to R-help. Thomas, do you have any idea what I may have entered wrongly?) Best, Christian Christian Ritz wrote: Hi Christian, I believe that the

[R] correlation

2008-10-16 Thread kdebusk
What test do I use to determine if there is a correlation between a discrete variable and a continuous variable? For example - I have water quality ratings for streams (excellent, good, fair, poor) and a corresponding nitrogen concentration for each rating. I want to know if the the ratings correl

Re: [R] One-sample test for p

2008-10-16 Thread Peter Dalgaard
Duncan Murdoch wrote: This isn't really about R, and maybe it is homework, but now that we got you in the appropriate frame of mind: (a) p values should look at "this or more unfavourable" events. You have arranged things so that that translates to -6.13 or _lower_. I.e. you're looking a

[R] R package: autocorrelation in gamm

2008-10-16 Thread Guillermo Aravena Cuevas
Dear users I am fitting a Generalized Additive Mixed Models (gamm) model to establish possible relationship between explanatory variables (water temperature, dissolved oxygen and chlorophyll) and zooplankton data collected in the inner and outer estuarine waters. I am using monthly time-se

Re: [R] One-sample test for p

2008-10-16 Thread Duncan Murdoch
On 10/16/2008 7:35 AM, Peter Dalgaard wrote: rr400 wrote: Hi, i am doing a statistics course and am having trouble with an exercise where i need to determine whether my success rate at something is higher than 80%. I was successful in 29 out of 60 trials, so these were the commands i entered i

Re: [R] apply, t-test and p-values

2008-10-16 Thread Jorge Ivan Velez
Dear John, Yes. Assuming that 'sample2' is fixed, something like this should do what you want: # Data sets set.seed(123) sample1=matrix(rnorm(100),ncol=10) sample2=rnorm(10,5,4) # t-test p-values apply(X,1,function(x) t.test(x,sample2)$p.value) [1] 0.002348970 0.004733230 0.004810952 0.004907549

[R] apply, t-test and p-values

2008-10-16 Thread John Sorkin
R 2.7.2 Windows XP I am using apply to compute a series of Student's t-test from two matrices, sample1 and sample2. boo<-apply(sample1,1,t.test,sample2) I want to pick of the p-values from the tests, but can't seem to get it to work. I have tried several methods to get the values including: bo

Re: [R] Fw: Logistic regresion - Interpreting (SENS) and (SPEC)

2008-10-16 Thread Frank E Harrell Jr
Gad Abraham wrote: Frank E Harrell Jr wrote: Gad Abraham wrote: This approach leaves much to be desired. I hope that its practitioners start gauging it by the mean squared error of predicted probabilities. Is the logic here is that low MSE of predicted probabilities equals a better calibra

Re: [R] merge/combine data

2008-10-16 Thread jim holtman
try this: > x <- read.table(textConnection(" user_id site_id name + 11 11 februari + 21 11 redbook + 31 11 tips + 73 6 sleep + 83 6monitoring + 93 6 alarm"), header=T

Re: [R] One-sample test for p

2008-10-16 Thread Peter Dalgaard
rr400 wrote: Hi, i am doing a statistics course and am having trouble with an exercise where i need to determine whether my success rate at something is higher than 80%. I was successful in 29 out of 60 trials, so these were the commands i entered into R: n=60 p.hat=29/n p.0=0.8 se.0=sqrt(p.0*

Re: [R] NAs in color2D.matplot

2008-10-16 Thread Jim Lemon
bg708 wrote: Hi, I am trying to plot a large matrix by using color2D.matplot. A substantial part of the matrix has no data (NAs). However, when trying to plot it, I get an error. It is only when I change all NAs to zeros that it works, but that in some way introduces 'wrong' data. Is there any w

[R] One-sample test for p

2008-10-16 Thread rr400
Hi, i am doing a statistics course and am having trouble with an exercise where i need to determine whether my success rate at something is higher than 80%. I was successful in 29 out of 60 trials, so these were the commands i entered into R: >n=60 >p.hat=29/n >p.0=0.8 >se.0=sqrt(p.0*(1-p.0)/n) >

[R] about "granova" library

2008-10-16 Thread Fernando Marmolejo Ramos
Dear all Recently the "granova" package was launched. I installed but after when I invoked it in R it requested for other libraries. They were downloaded and install automatically. I tried to run the example syntax of “granova.1w” and “granova.2w” but two things happened: i) either a file called

Re: [R] Two last questions: about output

2008-10-16 Thread Gabor Grothendieck
Please read the last line of every message to r-help and provide reproducible code. On Thu, Oct 16, 2008 at 12:44 AM, Ted Byers <[EMAIL PROTECTED]> wrote: > Thanks Gabor, > > To be clear, would something like testframe$est[[i]] <- fp$estimate be > valid within my loop, as in (assuming I created te

  1   2   >