Re: [R] Write lower half of distance matrix only

2008-07-25 Thread pgseye
Great, thanks for that Jim, It does what I need it do do. Regards, Paul jholtman wrote: > > Does this do what you want: > >> x <- matrix(1:25,5) >> x > [,1] [,2] [,3] [,4] [,5] > [1,]16 11 16 21 > [2,]27 12 17 22 > [3,]38 13 18 23 > [4,]4

Re: [R] Simple vector question.

2008-07-25 Thread rkevinburton
Thank you this is exactly what I wanted. I was unaware of the 'aggregate' function. Now what if I want to know the sum of the sales per day AND per Category? So for the data below the DayOfYearSales for HOLIDAY and day 1 would be 2. Thank you. Kevin jim holtman <[EMAIL PROTECTED]> wrote:

Re: [R] error in test

2008-07-25 Thread jim holtman
Why do you declare a function 'wilcox.test' and then inside the function, call 'wilcox.test' again? The second 'recursive' call now has parameters that your function knows nothing about. I would advise you changing your function's name to something else. On Sat, Jul 26, 2008 at 12:52 AM, Paul Ad

[R] error in test

2008-07-25 Thread Paul Adams
Hello everyone, I am trying to use the following code: dat<-read.table(file="C:\\Documents.txt") class2<-read.table(file="C:\\Documents.txt") class1<-read.table(file="C:\\Documents .txt") dat<-as.data.frame(dat) dimnames(dat)[[1]]<-paste("g",c(1:nrow(dat)),sep="") l<-c(0,0,0

Re: [R] Simple vector question.

2008-07-25 Thread jim holtman
Is this what you want: > x Year DayOfYearSku Quantity CatIdCategory SubCategory 1 2007 1 1000911 10862 HOLIDAYChristmas 2 2007 1 1001381 11160 PET COSTUMES Famous (Licensed) 3 2007 1 1001941 10

[R] Simple vector question.

2008-07-25 Thread rkevinburton
I have some data that I read in via read.csv: sales2007 <- read.csv("Total2007.dat", header=TRUE) The data looks like: > sales2007[1:605,] Year DayOfYearSku Quantity CatId Category SubCategory 1 2007 1 1000911 10862HOLIDAY Christmas 2 20

Re: [R] Help with matrix

2008-07-25 Thread jim holtman
Is this what you want: > x <- read.table(textConnection("g1 g2 f + 3 4 10 + 2 1 30 + 4 4 50"), header=TRUE) > closeAllConnections() > # create empty matrix > mat <- matrix(0, max(x$g1), max(x$g2)) > mat[cbind(x[,1], x[,2])] <- x[,3] > mat [,1] [,2] [,3] [,4] [1,]000

[R] Help with matrix

2008-07-25 Thread Van Wyk, Jaap
Hi I have 3 vectors, say g1, g2 and f, where g1 and g2 contain the row and column indices of a matrix, with corresponding elements in f. How can I create a matrix containing the values in f ? For example: g1 g2 f 3 4 10 2 1 30 4 4 50 How can then get a matrix that looks as follows: 0

Re: [R] Selecting the first measurement only from a longitudinal sequence

2008-07-25 Thread jim holtman
Is this what you want: > x <- read.table(textConnection("ID Time Failuretime Censoringind > longitudinalmeasure + 1 0 35 0123 + 1 1035 0 120 + 1 25 35 1 123 + 2 023

Re: [R] Matrix from List

2008-07-25 Thread jim holtman
This gets you close to what you want. The 31/33 are row names that you can extract and store as actual columns, > x <- list('1995'=list('31'=1, '33'=2), '2006'=list('31'=3, '33'=4)) > y <- lapply(names(x), function(.L1){ + cbind(as.numeric(.L1),do.call(rbind, x[[.L1]])) + }) > (z <- do.call(r

Re: [R] Interactive plot using playwith() and abline

2008-07-25 Thread Felix Andrews
Indeed, the call you pass to playwith() must be a self-contained plot function. Try one of these: playwith( {plot(x,y); abline(lm(y~x)} ) playwith(plot(x,y, panel.last=abline(lm(y~x playwith(xyplot(y ~ x, type=c("p", "r"))) On Sat, Jul 26, 2008 at 1:52 AM, Christoph Scherber <[EMAIL PROTEC

Re: [R] melting a list: basic question

2008-07-25 Thread hadley wickham
On Fri, Jul 25, 2008 at 8:50 PM, hadley wickham <[EMAIL PROTECTED]> wrote: > On Fri, Jul 25, 2008 at 9:49 AM, baptiste auguie <[EMAIL PROTECTED]> wrote: >> Dear list, >> >> >> I'm trying to use the reshape package to perform a merging operation on a >> list of data.frames as illustrated below, >> >

Re: [R] melting a list: basic question

2008-07-25 Thread hadley wickham
On Fri, Jul 25, 2008 at 9:49 AM, baptiste auguie <[EMAIL PROTECTED]> wrote: > Dear list, > > > I'm trying to use the reshape package to perform a merging operation on a > list of data.frames as illustrated below, > >> a <- 1:10 >> example <- list( data.frame(a=a, b=sin(a)), data.frame(a=a, b=cos(a

Re: [R] 64-bit R on Mac OS X 10.4.5

2008-07-25 Thread Steven McKinney
Hello I haven't found better instructions, it's just not an easy thing to do. You might also consider joining the r-sig-mac group and reviewing threads there for additional information. Rather than try to configure, make and install with one giant command, I'd suggest breaking the task down unt

[R] parametric bootstrap

2008-07-25 Thread laila khalfan
Hi I am using the boot function in boot package. I am facing a problem in getting the values of bias and st.error in the output. r<-36n<-40shape<-2theta11<-exp(1) # (=2.718282)theta21<-exp(.5) #( =1.648721) m0<- function(Ti,Tj) #a function that generates the estimates{ loglik<-function(ti,tj,

[R] 64-bit R on Mac OS X 10.4.5

2008-07-25 Thread joseph
Hello I have a Mac OS X 10.4.5. I am trying to build a 64-bit R by following the directions on this page: http://r.research.att.com/building.html r_arch=x86_64 \ CC="gcc -arch x86_64 -std=gnu99" \ CXX="g++ -arch x86_64" \ OBJC="gcc -arch x86_64" \ F77="gfortran -arch x86_64" \ FC="gfortran -arch

[R] parametric bootstrap

2008-07-25 Thread laila khalfan
Hi I am trying to find a parametric bootstrap confidence interval and when I used the boot function I get zero bias and zero st.error? What could be my mistake? Thank you and take care. Laila [[alternative HTML version deleted]] __ R-help@r-proj

Re: [R] R-package install

2008-07-25 Thread cindy Guo
Thank you, Brian and Mark, I tried the win-builder on http://win-builder.r-project.org/. Is this what you mean? I uploaded the source code, and I didn't get any email after couple of hours. It should arrive after half an hour, as it is said on the webpage. Do you know what can happen? Cindy On

Re: [R] Installation error for RCurl in Redhat enterrpise 5

2008-07-25 Thread Momin, Amin A
Thankyou the curl-devel installation helped solve the error with RCurl and GEOquery. - Original Message - From: "Prof Brian Ripley" <[EMAIL PROTECTED]> To: "Amin A Momin" <[EMAIL PROTECTED]> Cc: r-help@r-project.org Sent: Friday, July 25, 2008 3:19:41 AM GMT -05:00 US/Canada Eastern Su

[R] [R-pkgs] Package np version 0.20-0 released to CRAN

2008-07-25 Thread Jeffrey S. Racine
Dear R users, An updated version of the np package has recently been uploaded to CRAN (version 0.20-0). Version 0.20-0 is documented in Tristen Hayfield and Jeffrey S. Racine (2008). Nonparametric Econometrics: The np Package. Journal of Statistical Software 27(5). URL http://www.jstatsoft.org/v2

Re: [R] Numerical question

2008-07-25 Thread Duncan Murdoch
On 25/07/2008 5:06 PM, Zhang Yanwei - Princeton-MRAm wrote: Hi all, I have n independent variables A_1, A_2, A_3,..,A_n, and each with known variances var(A_1), var(A_2),..., but unknown mean. How can I get the approximation of the variance of the product of the variables using numerical

[R] Selecting the first measurement only from a longitudinal sequence

2008-07-25 Thread john james
Dear R-help mailing list,   I have this problem, I have a joint  longitudinal and survival data of the form say   ID Time Failuretime Censoringind longitudinalmeasure 1  0 35  0    123 1  10    35 0 120  1   25   35 1 

Re: [R] How to pass function argument of same name to internal call?

2008-07-25 Thread Duncan Murdoch
On 25/07/2008 4:28 PM, Carl Witthoft wrote: I ran across this problem when playing with ccf(). Its function call is >function (x, y, lag.max = NULL, type = c("correlation", "covariance"), plot = TRUE, na.action = na.fail, ...) Internally, ccf() calls plot(), which digs up plot.acf() whos

[R] graphing regression coefficients and standard errors

2008-07-25 Thread Murali K
Hello, I am interested in plotting my regression analysis results(regression coefficients and standard errors obtained through OLS and Tobit models) in the form of graphs.What is the best way to accomplish this? Thanks. Murali Kuchibhotla [[alternative HTML version deleted]] ___

[R] fit.dist gnlm question, NaN and Inf results

2008-07-25 Thread Richard and Barbara Males
I am attempting to fit discrete data (daily counts of arrivals of recreational vessels at locks on a river) using the fit.dist package. Some distributions return values of NaN and Inf for certain situations, an example with Inf values is shown below. # of vessels:

[R] Thin frame line around R pdf output in LaTeX

2008-07-25 Thread Joseph Retzer
I'm using R 2.7 on an Intel MAC. When I produce a pdf graph, I save the output window from the menu to a pdf file. This gives a very nice quality graph. However when I include the graph in a LaTeX document (actually beamer presentation) using \includegraphics I get a graphic with a very light

Re: [R] Numerical question

2008-07-25 Thread Ted Harding
On 25-Jul-08 21:06:38, Zhang Yanwei - Princeton-MRAm wrote: > Hi all, >I have n independent variables A_1, A_2, A_3,..,A_n, and each > with known variances var(A_1), var(A_2),..., but unknown mean. How can > I get the approximation of the variance of the product of the variables > using num

Re: [R] Numerical question

2008-07-25 Thread stephen sefick
If it is in a data frame with the variables as columns try f <- cbind(a*b, b*c, c*d) sapply(f, function(x)var(x)) On Fri, Jul 25, 2008 at 5:06 PM, Zhang Yanwei - Princeton-MRAm < [EMAIL PROTECTED]> wrote: > Hi all, > I have n independent variables A_1, A_2, A_3,..,A_n, and each with > known

[R] Matrix from List

2008-07-25 Thread Nelson Villoria
Hello, I have a list in which each element is a list. I want to create a matrix indexed by the two indices of the list. I have been using do.call, but I am not getting what I want. Let me show you: > l.intercepts #the list that nests another list $`1995` $`1995`$`31` (Intercept) 25.37164 $`199

[R] Error in vector("double", length)

2008-07-25 Thread Kumudan
Please see the code below. When I try to run the variogram - vg.deft<-variog(rd,uvec=10) I keep getting this error- variog: computing omnidirectional variogram Error in vector("double", length) : vector size specified is too large Also, when I try to define distance-based neighborhood - nb.tr=dist

[R] Numerical question

2008-07-25 Thread Zhang Yanwei - Princeton-MRAm
Hi all, I have n independent variables A_1, A_2, A_3,..,A_n, and each with known variances var(A_1), var(A_2),..., but unknown mean. How can I get the approximation of the variance of the product of the variables using numerical computation, i.e. var(A_1*A_2*A_3*.*A_n)? Thanks. Since

Re: [R] R: create multi windows plot at the same time

2008-07-25 Thread ctu
par(mfrow=c(2,2)) is trying to open a 2*2 figures in one window, so you could see your v1,..v4 in one windows at the same time if you want they plot separately then you could use x11() for each plot() Chunhao Quoting Alessandro <[EMAIL PROTECTED]>: Hi I have a problem with par(mfrow=c(2,2)) c

Re: [R] plot zoo custom panel help

2008-07-25 Thread Gabor Grothendieck
I can't reproduce this. Put it all in a .R file, source it into a fresh session and see if you still get the problem. If you do still get an error email it to me and I'll try sourcing the file as well. On Fri, Jul 25, 2008 at 4:28 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > zoo 1.5-4 package

Re: [R] Bug in gap.plot

2008-07-25 Thread Carl Witthoft
Jim L: I tried your example under R 2.2.1, and sure enough it plotted points on the right-hand section. Sounds like a bug that got fixed in the newer versions. (BTW, I get a warning from plotrix about being built under 2.7, but it does seem to execute OK under 2.2.1). -- example used was

Re: [R] plot zoo custom panel help

2008-07-25 Thread stephen sefick
zoo 1.5-4 package version R 2.7.1 Mac OS X 10.3.5 and Windows XP #from data contained in my second post #this works fine plot(d) plot(d[,1]) #gives me this error message Error in plot.window(...) : invalid 'ylim' value I downloaded the latest version of zoo today as to out previous conversation.

[R] How to pass function argument of same name to internal call?

2008-07-25 Thread Carl Witthoft
I ran across this problem when playing with ccf(). Its function call is >function (x, y, lag.max = NULL, type = c("correlation", "covariance"), plot = TRUE, na.action = na.fail, ...) Internally, ccf() calls plot(), which digs up plot.acf() whose default style is type='h' . I wanted to pa

[R] R: create multi windows plot at the same time

2008-07-25 Thread Alessandro
Hi I have a problem with par(mfrow=c(2,2)) code, because I don’t understand this: par(mfrow=c(2,2)) plot(v1) plot(v2) plot(v3) plot(v4) it opens a v1 window and after close that window to open next v2 plot Da: stephen sefick [mailto:[EMAIL PROTECTED] Inviato: venerdì 25 luglio 200

[R] R-pmg (poor man gui) question

2008-07-25 Thread Ferry
Hello, I hope I am reaching the appropriate channel for asking question. I am a newbie with R and pmg. I am trying to create two gdroplist as the following: First list: West, South, North, East, MidWest Second list: States in the U.S For example, if on the first gdroplist I select value MidWest,

[R] Pairs() function: selective changing of ylim; use of key

2008-07-25 Thread David Afshartous
All, Two questions RE scatterplot matrices produced via pairs() function: 1) Is it possible to selectively change the ylim of one of the subplots? 2) Is a key allowed? I don't seem to be able to insert a manual key. Code below: dat = data.frame(Hour= rep(c(0:3), 4), Y1 = rnorm(16,1), Y2 = rno

[R] s-plus in R... simpler code

2008-07-25 Thread Fotis Papailias
Dear R-users, I have sent another mail some hour ago about a matlab Code I was trying to translate in R. Actually I have found a simpler code originally written in S-PLUS for the same function. Author's page -> http://math.bu.edu/people/murad/methods/locwhitt/ ===

Re: [R] plot zoo custom panel help

2008-07-25 Thread Gabor Grothendieck
Please clarify what the problem is. If its the lack of content in the plot that was already addressed. You mention ylim but its not clear what your comment refers to since the plot command does not use ylim. Also make sure you are using the latest version of zoo and identify the version in your p

Re: [R] Matrix barplot

2008-07-25 Thread Andreas Tille
On Fri, 25 Jul 2008, Nutter, Benjamin wrote: data <- data.frame(Year=c(2000,2001,2002), A=c(4,2,1), B=c(3,1,2), C=c(0,3,5)) data.mat <- as.matrix(data)[,2:4] rownames(data.mat) <- data$Year data.mat <- t(data.mat) barplot(data.mat,be

Re: [R] Dividing by 0

2008-07-25 Thread Patrick Burns
I would think that the result of your rolling calculation should be NA if there are NAs or NaNs in the window. Producing an error given NAs seems like a broken function to me. One of the main purposes of NA is so that you can do operations like what you want to do and get reasonable answers. P

Re: [R] Dividing by 0

2008-07-25 Thread Roland Rau
Hi, what about: mydata <- c(1,2,3,NA, Inf, -Inf, NaN, 5, 6, 7) mydata2 <- ifelse(is.na(mydata) | is.infinite(mydata), 0, mydata) mydata mydata2 nmarti wrote: I know I can use x <- na.omit(x), and other forms of this, to get rid of some of these errors. I know what y

[R] Percentile Estimation From Kernel Density Estimate

2008-07-25 Thread Jeffrey_Bromaghin
Has anyone developed a defensible method of estimating percentiles from a univariate kernel density estimate? I am working on a problem in which the density estimate is of interest, but I would also like to estimate the value of the variable for which the distribution was, say, 0.20. I spent som

Re: [R] transcript a matlab code in R

2008-07-25 Thread Berend Hasselman
Fotis Papailias wrote: > > > > local.whittle <- function(d, x, m) > { > n <- length(x) > t <- matrix(c(0:n1), nrow = n, ncol=1) > lambda <- (2*pi*t)/n > wx <- (2*pi*n)^(-1/2)*Conj(fft( Conj(x)))*exp(1i*lambda) > M1 <- m+1 > lambda2 <- lambda[2:M1] > wx2 <- wx[2:M1] > ix <- wx2*Conj(wx2) >

Re: [R] create multi windows plot at the same time

2008-07-25 Thread stephen sefick
or quartz() or windows() you could also use par(mfrow=c(2,2)) On Fri, Jul 25, 2008 at 3:05 PM, <[EMAIL PROTECTED]> wrote: > Hi, you only need to add x11() in front of plot(); > such as > x11() > Plot(v1) > x11() > Plot(v2) > .. > then R will open multi windows for you > > Chunhao > > > Quotin

Re: [R] Rolling range and regression calculations

2008-07-25 Thread Gabor Grothendieck
> library(zoo) > z <- zoo(101:110) > rollapply(z, 3, min) 2 3 4 5 6 7 8 9 101 102 103 104 105 106 107 108 > rollapply(z, 3, max) 2 3 4 5 6 7 8 9 103 104 105 106 107 108 109 110 > rollapply(z, 3, range) 2 101 103 3 102 104 4 103 105 5 104 106 6 105 107 7 106 108 8 10

Re: [R] Rolling range and regression calculations

2008-07-25 Thread stephen sefick
d <- cbind(rollapply(x, FUN="max", width=96), rollapply(x, FUN="min", width=96)) if you have fifteen minute interval data 1day is equal to 96 time steps. the brute force method would be cbind((x[,1]*x[,2]), (x[,2]*x[,3])) this should work On Fri, Jul 25, 2008 at 1:10 PM, rcoder <[EMAIL PROTECTE

Re: [R] create multi windows plot at the same time

2008-07-25 Thread ctu
Hi, you only need to add x11() in front of plot(); such as x11() Plot(v1) x11() Plot(v2) .. then R will open multi windows for you Chunhao Quoting Alessandro <[EMAIL PROTECTED]>: Ciao All I'd like to generate 4 windows plot to compare different relationship at the same time in R. Each p

Re: [R] Dividing by 0

2008-07-25 Thread nmarti
I'm well aware these are not errors, I guess I miss-wrote. I understand your concern. Thanks for passionately looking out for my well being, you saved my life. My variable has about 10,000 elements and sometime for the first 100 to 500 elements there is lots of 0's, so I end up with lots of NA/N

Re: [R] Rolling range and regression calculations

2008-07-25 Thread rcoder
You mean embedding something like a range() function in a rollapply function? I'm just not sure how it will handle outputting max and min values in sequence and in the correct columns. On a parallel topic, I would like to find some way of generating a matrix containing rows that are the product o

[R] create multi windows plot at the same time

2008-07-25 Thread Alessandro
Ciao All I'd like to generate 4 windows plot to compare different relationship at the same time in R. Each plot code is : Plot(v1) Plot(v2) Plot(v4) Plot(v4) But I did not find a right code in R. Ale [[alternative HTML version deleted]]

[R] need help in parametric bootstrap

2008-07-25 Thread laila khalfan
Hi I need help in understanding how does the parametric bootstrap confidence interval works. I have a step-stress model from gamma distribution, I plugged in the log-likelihood function to get the MLE`s of the three parameters alpha, theta1 and theta2. Now I need to find the parametric bootstrap

[R] transcript a matlab code in R

2008-07-25 Thread Fotis Papailias
Dear R-users, I am trying to translate a matlab code for calculating the Local Whittle estimator in time series with long memory originally written by Shimotsu and available free in his webpage ( http://www.econ.queensu.ca/pub/faculty/shimotsu/ ) The Matlab code is ==

Re: [R] Tutorial on rgl Graphics

2008-07-25 Thread Duncan Murdoch
On 7/25/2008 12:20 PM, Tom La Bone wrote: On further experimentation I find that "points" (via points3d) serve my purpose well (instead of the much prettier but more troublesome spheres). The default "point" appears to be a square. Is there a way to make it a circle? Not very easily. Now you c

Re: [R] Minor Bug in Documentation of merge()

2008-07-25 Thread Duncan Murdoch
On 7/25/2008 2:13 PM, Roland Rau wrote: Dear all, I would like to point to a minor bug in the documentation of merge(). The documentation (?merge) says all logical; all = L is shorthand for all.x = L and all.y = L. I think the correct description should be all logical; all = T is short

[R] Minor Bug in Documentation of merge()

2008-07-25 Thread Roland Rau
Dear all, I would like to point to a minor bug in the documentation of merge(). The documentation (?merge) says all logical; all = L is shorthand for all.x = L and all.y = L. I think the correct description should be all logical; all = T is shorthand for all.x = T and all.y = T. The so

Re: [R] R2WinBUGS problem

2008-07-25 Thread Uwe Ligges
Dear Troels, it is possible to start without inits if the problem to solve is appropriate, here is the changed "schools" example from the help page: model.file <- system.file(package="R2WinBUGS", "model", "schools.txt") data(schools) J <- nrow(schools) y <- schools$estimate sigma.y <- schools

Re: [R] plot zoo custom panel help

2008-07-25 Thread stephen sefick
I am still having the can't draw a plot without putting in a ylim value when trying to draw a plot. I have included reproducible code sorry for the previous post > #the below code is the way that I would like the plot to look. I have > tried > to write a panel function: > my.panel <- function(x

Re: [R] Maximization under constraits

2008-07-25 Thread Ben Bolker
Daniela Garavaglia virgilio.it> writes: > > I'm looking for a R function which can maximise this logliklihood function, > under the constraits a>0 e b>0 > > f<-function(param){ > > a<-param[1] > > b <-param[2] > > log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(

Re: [R] Matrix barplot

2008-07-25 Thread Andreas Tille
On Fri, 25 Jul 2008, Jim Lemon wrote: library(plotrix) Well, if I try this in the example of the previous poster I get nicely rendered fonts - which is the only difference I noticed. # barp groups data in columns, not rows, so transpose barp(t(atdat[,2:4]),names.arg=atdat[,1],col=2:4) Whil

Re: [R] melting a list: basic question

2008-07-25 Thread baptiste auguie
Given that I cannot arbitrarily change the data to make "a" an integer, can I still use "a" as a grouping variable? I tried melt(example, id = factor(a)) but it does not work either. Must this change from numeric values to factors be done before applying melt? Thanks, baptiste On 25 Jul

Re: [R] plot zoo custom panel help

2008-07-25 Thread Gabor Grothendieck
BB.zoo is missing so I can't run it but note that the panel funtion must draw the points or lines or whatever or else there will be nothing in the plot. See the examples in ?plot.zoo and in vignette("zoo-faq") On Fri, Jul 25, 2008 at 12:13 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > #the bel

Re: [R] extracting Pr>ltl from robcov/ols (Design)

2008-07-25 Thread Frank E Harrell Jr
Mark Difford wrote: ldb (?), I am trying to extract significance levels out of a robcov+ols call However, I can't figure out how to get to the significance (Pr>ltl). It is obviously calculating it because the call: It's calculated in print.ols(). See extract below. To see the whole functi

Re: [R] Package Hmisc, functions summary.formula() and latex(), options pdig, pctdig, eps and prmsd

2008-07-25 Thread Frank E Harrell Jr
David Hajage wrote: 2008/7/25 Frank E Harrell Jr <[EMAIL PROTECTED] > David Hajage wrote: Hello R users, I have several problems with the functions summary.formula and latex in package Hmisc. Here an example :

Re: [R] Write lower half of distance matrix only

2008-07-25 Thread jim holtman
Does this do what you want: > x <- matrix(1:25,5) > x [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13 18 23 [4,]49 14 19 24 [5,]5 10 15 20 25 > x[upper.tri(x)] <- NA > write.table(x, na="", row.names=FALSE,

Re: [R] Tutorial on rgl Graphics

2008-07-25 Thread Tom La Bone
On further experimentation I find that "points" (via points3d) serve my purpose well (instead of the much prettier but more troublesome spheres). The default "point" appears to be a square. Is there a way to make it a circle? Tom Duncan Murdoch-2 wrote: > > On 7/25/2008 11:01 AM, Tom La Bone

[R] plot zoo custom panel help

2008-07-25 Thread stephen sefick
#the below code is the way that I would like the plot to look. I have tried to write a panel function: my.panel <- function(x, y, ..., pf = parent.frame()) { axis(side=1, at = seq(rng[1], rng[2], 1/12), labels = n, tcl = -0.3) } #but it does not work and I am at a loss and help would be apprec

Re: [R] S4 class and Package NAMESPACE [NC]

2008-07-25 Thread Martin Morgan
Sylvain ARCHENAULT wrote: Hello, I am trying to make a R package with S4 classes. To do so, i do as usual (when no S4 were involved, i.e without NAMESPACE file) and I've got errors in class refering to other classes in the package. Probably because the files are collated in such a way that s

[R] Interactive plot using playwith() and abline

2008-07-25 Thread Christoph Scherber
Dear all, Is it possible to use abline() after calling playwith(plot(...)))? x=1:10 y=x^2 playwith(plot(x,y)) # works fine playwith({abline(lm(y~x))}) # doesn?t work Thanks! Christoph __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

Re: [R] melting a list: basic question

2008-07-25 Thread Dieter Menne
baptiste auguie exeter.ac.uk> writes: > > I'm trying to use the reshape package to perform a merging operation > on a list of data.frames as illustrated below, > > > a <- 1:10 > > example <- list( data.frame(a=a, b=sin(a)), data.frame(a=a, > > b=cos(a)) ) > > > > melt(example, id = a) > >

Re: [R] Tutorial on rgl Graphics

2008-07-25 Thread Duncan Murdoch
On 7/25/2008 11:01 AM, Tom La Bone wrote: After looking around a bit more I found the example I was looking for -- plotlm3d, which I found on the R wiki http://wiki.r-project.org/rwiki/doku.php?id=graph_gallery:new-graphics The original author was John Fox, and it was modified by Jose Clau

Re: [R] Fit a 3-Dimensional Line to Data Points

2008-07-25 Thread Hans W. Borchers
S. M. Niaz Arifin yahoo.com> writes: > > Hi Experts, > I am new to R, and was wondering how to do 3D linear > regression in R. In other words, I need to Fit a > 3-Dimensional Line to Data Points (input). > > I googled before posting this, and found that it is > possible in Matlab and other comme

[R] Maximization under constraits

2008-07-25 Thread Daniela Garavaglia
I'm looking for a R function which can maximise this logliklihood function, under the constraits a>0 e b>0 f<-function(param){ a<-param[1] b <-param[2] log(prod)-(a*s2)-(b*s)-n*log(1-((0.5*b/sqrt(a))*(exp((b^2)/(4*a)))*((sqrt(pi ))*(1-pnorm(-b/(2*sqrt(a)), mean=0, sd=1)} I've tri

Re: [R] Integrating R and Textmate

2008-07-25 Thread Hans-Jörg Bibiko
On 25.07.2008, at 17:06, Rob Goedman wrote: Art, Could it be the case TextMate is activating the wrong version of R (2.6 vs. 2.7.1). I do not believe this. TextMate is using the normal R Terminal. I invoked the following command in a Rdaemon environment: install.packages("ade4", repos="htt

[R] S4 class and Package NAMESPACE [NC]

2008-07-25 Thread Sylvain ARCHENAULT
Hello, I am trying to make a R package with S4 classes. To do so, i do as usual (when no S4 were involved, i.e without NAMESPACE file) and I've got errors in class refering to other classes in the package. So I use a NAMESPACE file to declare classes, it works fine, but now I have to declare ea

Re: [R] Integrating R and Textmate

2008-07-25 Thread Rob Goedman
Art, Could it be the case TextMate is activating the wrong version of R (2.6 vs. 2.7.1). Are you using R.app? If so, and if the R.app is in the dock, does the correct R dance when you send a file to R without R running? Rob On Jul 24, 2008, at 3:07 PM, Arthur Roberts wrote: To Whom It

Re: [R] Tutorial on rgl Graphics

2008-07-25 Thread Tom La Bone
After looking around a bit more I found the example I was looking for -- plotlm3d, which I found on the R wiki http://wiki.r-project.org/rwiki/doku.php?id=graph_gallery:new-graphics The original author was John Fox, and it was modified by Jose Claudio Faria and Duncan Murdoch. Below is a si

Re: [R] Insert rows into a pre-existing data frame

2008-07-25 Thread milton ruser
Hi "somebody" I hope this helps: df1<-data.frame(cbind(va=runif(3), vb=runif(3))) df1 df2<-data.frame(cbind(va=runif(3), vb=runif(3))) df2 df.blank<-data.frame(cbind(va=NA, vb=NA)) df.blank df.join<-rbind(df1, df.blank, df2) df.join Miltinho astronauta brazil On 7/25/08, [EMAIL PROTECTED

[R] melting a list: basic question

2008-07-25 Thread baptiste auguie
Dear list, I'm trying to use the reshape package to perform a merging operation on a list of data.frames as illustrated below, a <- 1:10 example <- list( data.frame(a=a, b=sin(a)), data.frame(a=a, b=cos(a)) ) melt(example, id = a) this produces the desired result, where the data.fram

Re: [R] Saving a workspace with "extras"?

2008-07-25 Thread J . delasHeras
Excellent! Thanks for the pointers. Although the functions were indeed loaded with a source() call... I'll recheck the behaviour and see if I get this to work how I want it. thanks again! Jose Quoting Sarah Goslee <[EMAIL PROTECTED]>: Functions you've loaded using source() should be sa

Re: [R] Saving a workspace with "extras"?

2008-07-25 Thread Sarah Goslee
Functions you've loaded using source() should be saved. For loading packages automatically, create a function called .First and save it in that workspace. Anything in that function will be carried out when the workspace is loaded. Sarah On Fri, Jul 25, 2008 at 10:27 AM, <[EMAIL PROTECTED]> wrot

[R] Saving a workspace with "extras"?

2008-07-25 Thread J . delasHeras
Hi everyone, I hope there's a simple way to achieve what I want, but I haven't found the way. I do microarray analysis using R and a number of packages as well as some functions created my myself. When I save the workspace, it saves all the data structures, that's great... But when I cli

[R] Insert rows into a pre-existing data frame

2008-07-25 Thread naw3
Hi, I'm sorry if this is a simple question. How do you insert a blank row into a data frame? I basically need to do this: old table: new table: C1 C2 C3 C1 C2 C3 1 32 34 1 32 34 2 52 23 54 2 52 23 _

[R] Chi-square parameter estimation

2008-07-25 Thread Julio Rojas
Hi. I have made 100 experiments of an M/M/1 queue, and for each one I have calculated both, mean and variance of the queue size. Now, a professor has told me that variance is usually chi-squared distributed. Is there a way in R that I can find the parameter that best fits a chi-square to the var

[R] "Multiple" Regressions indexed by goodness of fit

2008-07-25 Thread stephen sefick
I would like do batch linear regression and then only have the results with high R-squared's returned. Is there such a data mining package in R. 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 u

Re: [R] Scatterplot matrix one column vs. the rest of the dataset

2008-07-25 Thread stephen sefick
I figured it out- always include the numbers of the columns in the plot statement that you want to scatter. On Fri, Jul 25, 2008 at 9:23 AM, stephen sefick <[EMAIL PROTECTED]> wrote: > have a data frame composed of many columns. I would like to hold one > column constant and scatter plot it agia

Re: [R] Plink bed files

2008-07-25 Thread Robert Gentleman
Hi Frederico, You will likely have more luck asking about Bioinformatics related questions on the Bioconductor list, you might look at the rtracklayer package which can import bed files, if they really are bed files, and otherwise you would have to get the file format and write your own par

Re: [R] extracting Pr>ltl from robcov/ols (Design)

2008-07-25 Thread Mark Difford
ldb (?), >> I am trying to extract significance levels out of a robcov+ols call >> However, I can't figure out how to get to the significance (Pr>ltl). >> It is obviously calculating it because the call: It's calculated in print.ols(). See extract below. To see the whole function, do print.

Re: [R] Matrix barplot

2008-07-25 Thread ajay ohri
As a beginner also try downloading the rattle GUI , with all dependecies =true , or R Cmdr GUI.. these are both packages go to rattle.togaware.com for the rattle instructions and installations .its very very user friendly even though the purists think its infra dig.(kidding- Friday humour) Reg

Re: [R] glht after lmer with "$S4class-" and "missing model.matrix-" errors

2008-07-25 Thread Douglas Bates
You have a mismatch between glht and the model fit by lmer. A model fit by lmer is an object of an S4 class (that's what the "4" in the package name "lme4" is to indicate). The glht function, or possibly a default method for that generic, is treating the model as an S3 class object. Also, you sh

[R] Scatterplot matrix one column vs. the rest of the dataset

2008-07-25 Thread stephen sefick
have a data frame composed of many columns. I would like to hold one column constant and scatter plot it agianst all of the other columns? how do I do this? I have only been able to plot(x) and use indexes to create an entire scatterplot matrix, but not hold one constant. -- Let's not spend ou

Re: [R] Parallel Processing and Linear Regression

2008-07-25 Thread Martin Morgan
Hi Alan -- "Alan Spearot" <[EMAIL PROTECTED]> writes: > Does anybody have any suggestions regarding applying standard regression > packages lm(), hccm(), and others within a parallel environment? Most of > the packages I've found only deal with iterative processes (bootstrap) or > simple linear

Re: [R] Rolling range and regression calculations

2008-07-25 Thread stephen sefick
how about rollapply in the zoo package? On Fri, Jul 25, 2008 at 8:37 AM, rcoder <[EMAIL PROTECTED]> wrote: > > Hi Achim, > > Thanks for your reply. rollmean and rollmax functions exist, but is there > anything for returning the minima on a rolling basis? I know there is no > rollmin in the zoo li

[R] Plink bed files

2008-07-25 Thread Federico Calboli
Hi All, does anyone know how to import binary .bed files generated by Plink (http://pngu.mgh.harvard.edu/~purcell/plink/ ) into R? the Plink FAQ explains how to conver other types of files, not the .bed. Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology and Public Healt

[R] extracting Pr>ltl from robcov/ols (Design)

2008-07-25 Thread ldb
I am trying to extract significance levels out of a robcov+ols call. For background: I am analysing data where multiple measurements(2 per topic) were taken from individuals(36) on their emotional reaction (dependent variable) to various topics (3 topics). Because I have several emotions and a rot

Re: [R] Matrix barplot

2008-07-25 Thread Andreas Tille
On Fri, 25 Jul 2008, Nutter, Benjamin wrote: data <- data.frame(Year=c(2000,2001,2002), A=c(4,2,1), B=c(3,1,2), C=c(0,3,5)) data.mat <- as.matrix(data)[,2:4] rownames(data.mat) <- data$Year data.mat <- t(data.mat) barplot(data.mat,be

Re: [R] Rolling range and regression calculations

2008-07-25 Thread rcoder
Hi Achim, Thanks for your reply. rollmean and rollmax functions exist, but is there anything for returning the minima on a rolling basis? I know there is no rollmin in the zoo library. Thanks, rcoder Achim Zeileis wrote: > > On Thu, 24 Jul 2008, rcoder wrote: > >> Hi everyone, >> >> I want

[R] Errror in running R2.7.1 version to R2.6.2 version

2008-07-25 Thread Lazarus Mramba
Dear all, I get an error shown below when i run the command "use" found in package epicalc on R2.7.1 and R2.7.0 but dont get the error when i run it on R 2.6.2 What is likely to be the problem? library(epicalc) Loading required package: foreign Loading required package: survival Loading required

  1   2   >