[R] Passing a pointer to .C() in Win32

2004-04-15 Thread James Wettenhall
I sent this to R-help recently, but I'm not sure if it was received correctly. It it is in: https://www.stat.math.ethz.ch/pipermail/r-help/2004-April.txt.gz but not yet in: http://tolstoy.newcastle.edu.au/R/help/04/04/index.html Apologies if I've sent it twice. On Thu, 15 Apr 2004, James Wettenha

RE: [R] Turning windows screen buffering on and off

2004-04-15 Thread Toby.Patterson
I meant via a function or something like: options( buffered.output = FALSE) Sorry, I should have made that clearer. Cheers Toby -Original Message- From: Roger D. Peng [mailto:[EMAIL PROTECTED] Sent: Friday, April 16, 2004 1:11 PM To: Patterson, Toby (Marine, Hobart) Cc: [EMAIL P

[R] estimate distributed lag model using matrix algebra

2004-04-15 Thread Linda portman
Has anyone writtent an R function for estimating linear models with distributed lags(using matrix algebra)? Yt=B0+S j=1j=10 Xt-j+e Thanks a lot! - [[alternative HTML version deleted]] __ [

Re: [R] Turning windows screen buffering on and off

2004-04-15 Thread Roger D. Peng
Ctrl-W. -roger [EMAIL PROTECTED] wrote: All, Does anyone know if there is an option I can set to turn screen-buffered output on and off with the win32 rgui? (Apart from the point and click method). I am running some simulations where it is useful to watch output but it gets mildly tiresome ha

Re: [R] install packages

2004-04-15 Thread Sundar Dorai-Raj
Linda portman wrote: I am trying to install packages, WHat i did is: options(CRAN= "http://cran.us.r-project.org/";) install.packages("pakgs") However I got error message like: trying URL `http://cran.us.r-project.org//bin/windows/contrib/PACKAGES' Error in download.file(url = paste(contribu

Re: [R] install packages

2004-04-15 Thread Jason Turner
> I am trying to install packages, WHat i did is: > > options(CRAN= "http://cran.us.r-project.org/";) > install.packages("pakgs") Is that really the package name? I can't find it on CRAN. > However I got error message like: ... > argument `lib' is missing: using C:/PROGRA~1/R/rw1051/library in:

[R] install packages

2004-04-15 Thread Linda portman
I am trying to install packages, WHat i did is: options(CRAN= "http://cran.us.r-project.org/";) install.packages("pakgs") However I got error message like: trying URL `http://cran.us.r-project.org//bin/windows/contrib/PACKAGES' Error in download.file(url = paste(contriburl, "PACKAGES", sep = "

RE: [R] Removing values from a vector

2004-04-15 Thread Liaw, Andy
Use negative indexing; e.g., pop <- pop[-c(3, 7)] removes the 3rd and 7th element of pop. Andy > From: Joseph Sakshaug > > Dear R-help faithful, > > I am trying to build a program which will take repeated samples (w/o > replacement) from a population of values. The interesting > catch is that

[R] Removing values from a vector

2004-04-15 Thread Joseph Sakshaug
Dear R-help faithful, I am trying to build a program which will take repeated samples (w/o replacement) from a population of values. The interesting catch is that I would like the sample values to be removed from the population, after each sample is taken. For example: pop<-1:10 sample(pop, 2)

Re: [R] Distributed lag model

2004-04-15 Thread Jason Turner
> > Has anyone writtent an R function for estimating linear > models with distributed lags(using matrix algebra)? > > Y(t) = Bo + B1Xt-1+ B2Xt-2+e > The "dse" bundle, with libraries "dse1" and "dse2" have functions for this in VARX or state space form. Cheers Jason _

[R] Turning windows screen buffering on and off

2004-04-15 Thread Toby.Patterson
All, Does anyone know if there is an option I can set to turn screen-buffered output on and off with the win32 rgui? (Apart from the point and click method). I am running some simulations where it is useful to watch output but it gets mildly tiresome having to manually switch things on and off

[R] Distributed lag model

2004-04-15 Thread Linda portman
Has anyone writtent an R function for estimating linear models with distributed lags(using matrix algebra)? Y(t) = Bo + B1Xt-1+ B2Xt-2+e Thanks, - [[alternative HTML version deleted]] __

Re: [R] Course***May-June 2004***R/Splus Programming Techniques, @ 5 locations near you!

2004-04-15 Thread Jason Turner
Peter Dalgaard wrote: I was actually reading it with some curiosity as to how they managed to find 5 locations that were close to everyone on R-help... "Close, for sufficiently large values of 'close'..." :D Jason __ [EMAIL PROTECTED] mailing list https:

Re: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Richard A. O'Keefe
"Liaw, Andy" <[EMAIL PROTECTED]> wrote: I was bitten by the behavior of all() when given logical(0): It is TRUE! (And any(logical(0)) is FALSE.) Wouldn't it be better to return logical(0) in both cases? It would be disastrous. For all integer n >= 0, all(

Re: [R] sort boxplot to median

2004-04-15 Thread Sundar Dorai-Raj
H. Bromberger wrote: Dear guRus, I'm stuck and really would appreciate some help. I've already crawled the net... I want to do some Boxplot which are sorted by the median and not alphabetically. What I did so far: x <- subset(mydata, Verwalt.Doku==1, select=c(1, 2)) P <- plot(x[,1], x[,2], plot

Re: [R] Solving Matrices

2004-04-15 Thread Richard A. O'Keefe
Elizabeth (etb <[EMAIL PROTECTED]>) wrote: In execises 39-42, determine if the columns of the matrix span R4: 4 Presumably that's R, 4-dimensional real space. (or x <- matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5,

Re: [R] Course***May-June 2004***R/Splus Programming Techniques, @ 5 locations near you!

2004-04-15 Thread Peter Dalgaard
Bob Cain <[EMAIL PROTECTED]> writes: > Was there supposed to be any content to this post? It doesn't bode > well for the course. :-) I was actually reading it with some curiosity as to how they managed to find 5 locations that were close to everyone on R-help... > "Things should be described a

Re: [R] Course***May-June 2004***R/Splus Programming Techniques, @ 5 locations near you!

2004-04-15 Thread Bob Cain
Was there supposed to be any content to this post? It doesn't bode well for the course. :-) Bob [EMAIL PROTECTED] wrote: __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http:/

RE: [R] Complex sample variances

2004-04-15 Thread Fred Rohde
Thanks for the explanation. And for all your work on this package. Thomas Lumley <[EMAIL PROTECTED]> wrote:On Wed, 14 Apr 2004, Fred Rohde wrote: > I wasn't sure if JRR or BRR methods were valid for quantiles? BRR is valid, as is Fay's method, a smoothed version. The jackknife methods probably

[R] sort boxplot to median

2004-04-15 Thread H. Bromberger
Dear guRus, I'm stuck and really would appreciate some help. I've already crawled the net... I want to do some Boxplot which are sorted by the median and not alphabetically. What I did so far: x <- subset(mydata, Verwalt.Doku==1, select=c(1, 2)) P <- plot(x[,1], x[,2], plot=F) ???sort(P$stats[3,])?

[R] Course***May-June 2004***R/Splus Programming Techniques, @ 5 locations near you!

2004-04-15 Thread elvis
__ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

RE: [R] I do not achieve to install some packages

2004-04-15 Thread Ko-Kang Kevin Wang
Hi, > -Original Message- > From: [EMAIL PROTECTED] > I can't load the packages locfit, lokern and quantreg. > When I try to load the 3 packages the R program says that the > pakages are not properly installed. He says to see the note > in ?library. > I think that the error is because there

Re: [R] how to add legend to time series plot

2004-04-15 Thread Jason Turner
Uwe Ligges wrote: I guess it is clipped in this case. Use par("usr") after ts.plot() to see what the user coordinates are, and whether (1, -0.3) is a sensible location to place the legend. Uwe Ligges Just to add to Uwe's good suggestion -- what I usually do is opar <- par(no.readonly=TRUE) par(

Re: [R] basic programming question

2004-04-15 Thread Don MacQueen
There are indeed a number of ways to do this. If all have exactly the same number of values, and they have the same times, then a matrix or dataframe would be a reasonable place to store them. In that case I would have one column per file. Otherwise, I would tend to use a list. Here is a toy i

[R] filled.contour

2004-04-15 Thread jzhang10
Hi, I want to draw a level plot. The levels are not evenly spaced, so I did something like: levels=c(0,2,5,10,30,60). I still want the color bar (key) on the right side to be evenly spaced so that the small numbers (0,2,5) are not squeezed together. Does anyone know how to do it? Thanks! Jinfeng

Re: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Patrick Burns
I suspect that some people still might not have caught why the behavior is a good thing. We want any(c(A, B)) to give the same answer as any(A) || any(B) This should be the behavior even if all of the elements are in one of the vectors. This actually is useful in coding, though I can't think of

[R] I do not achieve to install some packages

2004-04-15 Thread Rui Martins
I can't load the packages locfit, lokern and quantreg. When I try to load the 3 packages the R program says that the pakages are not properly installed. He says to see the note in ?library. I think that the error is because there is no built field in the 3 packages. What can I do to make the packa

Re: [R] how to cite a library

2004-04-15 Thread Roger D. Peng
Take a look at this thread: https://www.stat.math.ethz.ch/pipermail/r-help/2004-February/044162.html In general, it depends, but for MASS you should probably cite the book by Venables & Ripley. -roger Tu Yu-Kang wrote: Dear R users, I used the multivariate random numbers generation function i

Re: [R] Solving Matrices

2004-04-15 Thread etb
James writes: > Have you tried det(x) and/or eigen(x) ? > > A zero determinant (within computer precision) means that the matrix > does not have full rank, i.e. it does not span R4. Count how many > eigenvalues are zero (within computer precision). What does this > tell you? I'm still on chapt

Re: [R] tapply() and barplot() help files for 1.8.1

2004-04-15 Thread Duncan Murdoch
On Thu, 15 Apr 2004 18:10:27 +0200, Martin Maechler <[EMAIL PROTECTED]> wrote : >> "David" == David Whiting <[EMAIL PROTECTED]> >> on 15 Apr 2004 11:42:18 + writes: > >David> Hi, > >David> I've just upgraded to 1.9.0 and one of my Sweave >David> files that produces a nu

Re: [R] install.packages

2004-04-15 Thread Martin Maechler
> "R" == R Heberto Ghezzo <[EMAIL PROTECTED]> > on Thu, 15 Apr 2004 12:16:03 -0400 writes: R> Hello, I just downloaded RW1090. No problems. My thanks R> to everybody involved in the project. I work in Win98 I R> updated my library, some problems with some files that R>

RE: [R] un-expected return by fdim

2004-04-15 Thread Liaw, Andy
> From: Fred J. > > > what is fdim()? > a package from CRAN which calculate the fractal > dimension of datasets. > once you have it installed do > >library(fdim) > >help(fdim) That's not the point. [Uwe said:] > > Please, consider to follow the posting guide and > > help the readers of > > this

Re: [R] install.packages

2004-04-15 Thread Peter Dalgaard
"R. Heberto Ghezzo" <[EMAIL PROTECTED]> writes: > Hello, > I just downloaded RW1090. No problems. My thanks to everybody involved in the > project. I work in Win98 > I updated my library, some problems with some files that were in the PACKAGES list > but not in 1.9/ site, now all are. > I tried to

Re: [R] un-expected return by fdim

2004-04-15 Thread Fred J.
> what is fdim()? a package from CRAN which calculate the fractal dimension of datasets. once you have it installed do >library(fdim) >help(fdim) thanks > > > fdim > Error: Object "fdim" not found > > > Please, consider to follow the posting guide and > help the readers of > this list to eas

[R] install.packages

2004-04-15 Thread R. Heberto Ghezzo
Hello, I just downloaded RW1090. No problems. My thanks to everybody involved in the project. I work in Win98 I updated my library, some problems with some files that were in the PACKAGES list but not in 1.9/ site, now all are. I tried to install "Zelig" from Harvard install.packages("Zelig",CRAN="

Re: [R] tapply() and barplot() help files for 1.8.1

2004-04-15 Thread Martin Maechler
> "David" == David Whiting <[EMAIL PROTECTED]> > on 15 Apr 2004 11:42:18 + writes: David> Hi, David> I've just upgraded to 1.9.0 and one of my Sweave David> files that produces a number of barplots in a David> standard manner now produces them in a different way.

Re: [R] Solving Matrices

2004-04-15 Thread Gabor Grothendieck
wehi.EDU.AU> writes: : : On April 15th, Elizabeth wrote: : : > In execises 39-42, determine if the columns of the matrix span : > R4: : : >(or x <- matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5, : >4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4) : > : >That is the wh

RE: [R] how to cite a library

2004-04-15 Thread Liaw, Andy
The MASS package (not library) is part of the `VR' bundle, and support software for MASS the book. You should cite the book. Andy > From: Tu Yu-Kang > > Dear R users, > > I used the multivariate random numbers generation function in > MASS for my > study. I wonder what is an approriate way

RE: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Liaw, Andy
Thanks to Rolf, Thomas, Duncan & Doug for the explanations! It's one of those things that I should have remembered from high school but clearly didn't... I've changed my code to: [If y is factor:] if (!is.null(ytest)) { if (!is.factor(ytest)) stop("ytest must be a factor")

[R] how to cite a library

2004-04-15 Thread Tu Yu-Kang
Dear R users, I used the multivariate random numbers generation function in MASS for my study. I wonder what is an approriate way to cite the library and its authors in my publication to express my gratefulness? best regards, Yu-Kang __ [EMAIL PROT

Re: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Douglas Bates
"Liaw, Andy" <[EMAIL PROTECTED]> writes: > I wrote: > > > I was bitten by the behavior of all() when given logical(0): > > It is TRUE! > > (And any(logical(0)) is FALSE.) Wouldn't it be better to > > return logical(0) > > in both cases? > > I guess the behavior is consistent with: > > > pro

Re: [R] basic programming question

2004-04-15 Thread MMarques Power
Hello Randy, Thursday, April 15, 2004, 4:08:14 PM, you wrote: RZ> I am just starting to write some R functions (R 1.8 and Windows XP) and RZ> got stuck as described below: RZ> We have a bunch of time series data files, each is about 10,000 values. RZ> There is a 12-line header in each one. I can

Re: [R] Dates stuff ... beginner question

2004-04-15 Thread Uwe Ligges
MMarques Power wrote: Putting it simly I have a date in format MMDD Year month day 20030301 and I need simply the day of the week as an integer or even as string... according to the documentation in ISOdate or strptime functions I need to format it ... If I try something like : strptime("2003

Re: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Duncan Murdoch
On Thu, 15 Apr 2004 10:40:41 -0400, "Liaw, Andy" <[EMAIL PROTECTED]> wrote : >Dear R-help, > >I was bitten by the behavior of all() when given logical(0): It is TRUE! >(And any(logical(0)) is FALSE.) Wouldn't it be better to return logical(0) >in both cases? As Rolf said, this behaviour makes s

[R] basic programming question

2004-04-15 Thread Randy Zelick
Hello list, I am just starting to write some R functions (R 1.8 and Windows XP) and got stuck as described below: We have a bunch of time series data files, each is about 10,000 values. There is a 12-line header in each one. I can read them and plot them easily with R, but I want to make an auto

[R] Dates stuff ... beginner question

2004-04-15 Thread MMarques Power
Putting it simly I have a date in format MMDD Year month day 20030301 and I need simply the day of the week as an integer or even as string... according to the documentation in ISOdate or strptime functions I need to format it ... If I try something like : strptime("20030301","%u") [1] "200

Re: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Thomas Lumley
On Thu, 15 Apr 2004, Liaw, Andy wrote: > Dear R-help, > > I was bitten by the behavior of all() when given logical(0): It is TRUE! > (And any(logical(0)) is FALSE.) Wouldn't it be better to return logical(0) > in both cases? No, it wouldn't. The convention that "For all x in A: P(x)" is true w

Re: [R] Non-Linear Regression Problem

2004-04-15 Thread Spencer Graves
Have you considered "try"? When I do this, I prefer to parameterize the problem to avoid situations where the function is undefined and provide alternative algorithms were a function will have numerical difficulties. For example, suppose I want (sin(x)/x), and I get NA when x = 0.

RE: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Liaw, Andy
I wrote: > I was bitten by the behavior of all() when given logical(0): > It is TRUE! > (And any(logical(0)) is FALSE.) Wouldn't it be better to > return logical(0) > in both cases? I guess the behavior is consistent with: > prod(numeric(0)) [1] 1 > sum(numeric(0)) [1] 0 but why? Andy >

Re: [R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Rolf Turner
Andy Liaw wrote: > I was bitten by the behavior of all() when given logical(0): It is > TRUE! (And any(logical(0)) is FALSE.) Wouldn't it be better to > return logical(0) in both cases? It seems to me that what R does is strictly speaking correct. Anything you say about the members of the emp

RE: [R] Complex sample variances

2004-04-15 Thread Thomas Lumley
On Wed, 14 Apr 2004, Fred Rohde wrote: > I wasn't sure if JRR or BRR methods were valid for quantiles? BRR is valid, as is Fay's method, a smoothed version. The jackknife methods probably aren't. At some point I should probably try to add bootstrap methods for designs where BRR doesn't fit well.

[R] vectorizing row selection

2004-04-15 Thread Corey Moffet
Dear R-help: I have a data frame (df1) with elements a, b, and c that identify a unique set of conditions of interest; l and m identify other conditions; and x and y are responses. df1 <- data.frame(a = c(1,1,1,2,2,2,3,3,3), b = c(10,10,10,20,20,20,30,30,30), c = c(100,100,100,2

[R] residuals

2004-04-15 Thread Shawn Way
I'm trying to determine the lack of fit for regression on the following: data <- data.frame(ref=c(0,50,100,0,50,100), actual=c(.01,50.9,100.2,.02,49.9,100.1), level=gl(3,1)) fit <- lm(actual~ref,data) fit.aov <- aov(actual~ref+Error(level)

[R] all(logical(0)) and any(logical(0))

2004-04-15 Thread Liaw, Andy
Dear R-help, I was bitten by the behavior of all() when given logical(0): It is TRUE! (And any(logical(0)) is FALSE.) Wouldn't it be better to return logical(0) in both cases? The problem surfaced because some un-named individual called randomForest(x, y, xtest, ytest,...), and gave y as a two-

Re: [R] un-expected return by fdim

2004-04-15 Thread Uwe Ligges
Fred J. wrote: Browse[1]> Lframe v v v v v v v v 1 8 7 6 5 4 3 2 1 2 9 8 7 6 5 4 3 2 3 10 9 8 7 6 5 4 3 4 11 10 9 8 7 6 5 4 5 12 11 10 9 8 7 6 5 6 13 12 11 10 9 8 7 6 7 14 13 12 11 10 9 8 7 8 15 14 13 12 11 10 9 8 Browse[1]> fdim(Lframe,q=2) Error in slopeopt(All

Re: [R] Solving Matrices

2004-04-15 Thread Erich Neuwirth
On April 15th, Elizabeth wrote: (or x <- matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5, 4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4) qr(x)$rank gives the rank qr.R(qr(x)) gives the R part (an upper triangular matrix similar to the one produced by Gauss elimination). With the g

[R] R apache and PHP

2004-04-15 Thread Junwen wang
Apache may not aware the PATH to R, try 'exec("/pathToR/R CMD ...")'. In addition, apache and R should be in the same physical driver. -Junwen > I've developed a web application in PHP and R > > my script is > > > > ... > exec("R CMD BATCH --silent /home/marcello/R_in/myfile.bat > /home/marcello

Re: [R] Solving Matrices

2004-04-15 Thread Douglas Bates
[EMAIL PROTECTED] writes: > On April 15th, Elizabeth wrote: > > > In execises 39-42, determine if the columns of the matrix span > > R4: > > >(or x <- matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5, > >4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4) > > > >That is the wh

Re: [R] Use R function in C code

2004-04-15 Thread Douglas Bates
James Wettenhall <[EMAIL PROTECTED]> writes: > Hi, > > On Fri Apr 2, xt_wang wrote: > > I want to use R function Matrix inverse in my c code, please > > tell me how I can. > > If there is a sample which can tell me how it works. It will > > be fantastic. > > A good place to start learning how

Re: [R] binary numbers

2004-04-15 Thread Martin Maechler
> "Samuel" == Samuel Edward Kemp <[EMAIL PROTECTED]> > on Wed, 14 Apr 2004 22:20:24 +0100 writes: Samuel> Hi, Is there a function in R that lets one represent Samuel> an integer in binary format for a given number of Samuel> bits? So an example would be >> binary.f

Re: [R] summary(difftime(...))

2004-04-15 Thread Jim Lemon
I M S White wrote: > Is there any way to get a numerical summary of the values of a difftime > object? E.g. > > TimeToWean <- difftime(WeanDate, BirthDate, units = "days") > > I can repeat > > sum(TimeToWean == 20) > > with as many other values are needed to build up a frequency table, > but is the

Re: [R] pretty for a log-axis

2004-04-15 Thread Martin Maechler
> "BXC" == BXC (Bendix Carstensen) <[EMAIL PROTECTED]> > on Thu, 15 Apr 2004 09:54:49 +0200 writes: BXC> Is there a function that does the same as pretty but on BXC> a log-scale? Suppose you have BXC> x <- exp( runif( 100, 0, 6 ) ) BXC> (which will between 1 and 403)

Re: [R] summary(difftime(...))

2004-04-15 Thread Uwe Ligges
I M S White wrote: Is there any way to get a numerical summary of the values of a difftime object? E.g. TimeToWean <- difftime(WeanDate, BirthDate, units = "days") I can repeat sum(TimeToWean == 20) with as many other values are needed to build up a frequency table, but is there a simpler way i

[R] summary(difftime(...))

2004-04-15 Thread I M S White
Is there any way to get a numerical summary of the values of a difftime object? E.g. TimeToWean <- difftime(WeanDate, BirthDate, units = "days") I can repeat sum(TimeToWean == 20) with as many other values are needed to build up a frequency table, but is there a simpler way in R version 1.8.1?

RE: [R] A bug report?

2004-04-15 Thread Liaw, Andy
Your question has been answered by others. I just want to point out that you should not be calling summary.lm() directly, but should call the generic summary() instead. Andy > From: Ajay Shah > > Folks, > > I have a strange situation, which I may have isolated as a bug > report. Or, it could j

Re: [R] how to add legend to time series plot

2004-04-15 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: Dear all, I would like to add a legend to a time series plot, but cannot get it done. I have searched the archive about this, but to no avail ... I have three sets of time series data stored in a matrix wMat. The following code plots the the data with a legend, but it d

[R] RE: trend turning points

2004-04-15 Thread Highland Statistics Ltd.
Dear Joerg, See http://www.brodgar.com/timeseries.htm and especially: http://www.brodgar.com/chronoexample.htm http://www.brodgar.com/chronoexample2.htm for methodology and examples of detecting breakpoints in multivariate time series. Kind regards, Alain Zuur www.brodgar.com www.highstat.c

RE: [R] Solving Matrices

2004-04-15 Thread wettenhall
On April 15th, Elizabeth wrote: > In execises 39-42, determine if the columns of the matrix span > R4: >(or x <- matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5, >4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4) > >That is the whole of the question Have you tried det(x) a

Re: [R] binary numbers

2004-04-15 Thread Robin Hankin
Hi Sam. Try: as.binary <- function(n,base=2 , r=FALSE) { out <- NULL while(n > 0) { if(r) { out <- c(out , n%%base) } else { out <- c(n%%base , out) } n <- n %/% base } return(out) } HTH robin Hi, Is there a function in R that lets one represent an inte

Re: [R] binary numbers

2004-04-15 Thread Samuel Edward Kemp
Hi, I just wrote a little C program (and interfaced it with R) that does it for me, but I will take a look at that function. Cheers, Sam. Uwe Ligges wrote: Samuel Edward Kemp wrote: Hi, Is there a function in R that lets one represent an integer in binary format for a given number of bit

Re: [R] binary numbers

2004-04-15 Thread Uwe Ligges
Samuel Edward Kemp wrote: Hi, Is there a function in R that lets one represent an integer in binary format for a given number of bits? So an example would be > binary.function(num=5, num.of.bits=8) > "0101" Or, is this something I have to write myself? Any help would be appreciated.

Re: [R] odbcFetchRows not work?

2004-04-15 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: Hi, excuse me i am newbee in R, but i dont understand the following code not work. Libro1.xls have two files and not load in R, under windows. Thanks library(RODBC) f<-file.choose() f [1] "C:\\Mis documentos\\ruben\\r19\\Libro1.xls" help(odbcConnectExcel) canal<- odbcCo

[R] binary numbers

2004-04-15 Thread Samuel Edward Kemp
Hi, Is there a function in R that lets one represent an integer in binary format for a given number of bits? So an example would be > binary.function(num=5, num.of.bits=8) > "0101" Or, is this something I have to write myself? Any help would be appreciated. Cheers, Sam. _

[R] tapply() and barplot() help files for 1.8.1

2004-04-15 Thread David Whiting
Hi, I've just upgraded to 1.9.0 and one of my Sweave files that produces a number of barplots in a standard manner now produces them in a different way. I have made a couple of small changes to my code to get the back the output I was getting before upgrading and now (mostly out of curiosity) wo

RE: [R] trend turning points

2004-04-15 Thread Pfaff, Bernhard
> > > > does anybody know of a nice test to detect trend turning points in > > time series? Possibly with reference? > > You can look at the function breakpoints() in the package strucchange > and the function segmented() in the package segmented which do > segmentation of (generalized) linear re

[R] pretty for a log-axis

2004-04-15 Thread BXC (Bendix Carstensen)
Is there a function that does the same as pretty but on a log-scale? Suppose you have x <- exp( runif( 100, 0, 6 ) ) (which will between 1 and 403), then I would like to have a result like: log.pretty( x ) [1] 1 5 10 50 100 500 Bendix C. -- Bendix Carstensen Senior Statist

[R] Solving Matrices

2004-04-15 Thread etb
Hi Everyone, I'm new here and am using R for studying linear algebra with Lay's Linear Algebra and Its Applications (2nd Edition). Some of the exercises are to be solved via computer or calculator and instructions are provided on how to use Maple, Mathematica, etc. but neither R nor S. So f