[R] Appending diagnostic information to all lines sent to stdout and stderr

2008-06-18 Thread Thomas Allen
Dear All I'm logging the stdout and stderr of an R program into two separate files (stderr.txt and stdout.txt) using sink() I would like to append extra information such as "date", "memory usage" etc to every line of output that goes to stdout or stderr. For example > cat("hello \n") should giv

Re: [R] (no subject)

2008-06-18 Thread Hans-Jörg Bibiko
On 19.06.2008, at 07:24, Paul Adams wrote: Hello everyone, I am wanting to replace an element in a matrix with NA. I have used the following code dat<-read.table(file="C:\\Documents and Settings\ \txt",header=T,row.names=1) file.show(file="C:\\Documents and Settings\\txt") Z.matrix<

Re: [R] Any simple way to subset a vector of strings that do contain a particular substring ?

2008-06-18 Thread Philipp Pagel
> strings <- c("", "","ccba"). > > How to get "", "" that do not contain "ba" ? I think this is what you want: > foo <- c("", "","ccba") > foo[-grep('ba', foo)] [1] "" "" cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Te

[R] S4 pass-by-value work-around?

2008-06-18 Thread Jeffrey Spies
Howdy all, I have a problem that I'd like some advice/help in solving---it has to do with R's pass-by-value system. I understand the issue, but am wondering if anyone has found a working solution in dealing with it for cases when one wants to modify an object inside of a method, specifically whe

Re: [R] try to find the MLE of a function

2008-06-18 Thread Moshe Olshansky
Hi, mle caused me some confusion too. Anyway, first of all, your x should not contain 0, so make it, let say, (1:10)/10. Secondly, f should not be the density, but -log(density), so in your case it should be f <-function(theta) -sum(log(theta) + (theta-1)*log(x)) and finally you must specify a

Re: [R] Any simple way to subset a vector of strings that do contain a particular substring ?

2008-06-18 Thread Bernhard
Hi Daren. you could try something like: strings[setdiff(1:length(strings), grep("ba", strings))] ?grep as well as ?regexpr will help as well! Bernhard 2008/6/19 Daren Tan <[EMAIL PROTECTED]>: > > > For example, > > strings <- c("", "","ccba"). > > How to get "", "" that do not

Re: [R] Any simple way to subset a vector of strings that do contain a particular substring ?

2008-06-18 Thread Moshe Olshansky
strings[-grep("ba",strings)] --- On Thu, 19/6/08, Daren Tan <[EMAIL PROTECTED]> wrote: > From: Daren Tan <[EMAIL PROTECTED]> > Subject: [R] Any simple way to subset a vector of strings that do contain a > particular substring ? > To: [EMAIL PROTECTED] > Received: Thursday, 19 June, 2008, 3:18 P

[R] (no subject)

2008-06-18 Thread Paul Adams
Hello everyone, I am wanting to replace an element in a matrix with NA. I have used the following code dat<-read.table(file="C:\\Documents and Settings\\txt",header=T,row.names=1) file.show(file="C:\\Documents and Settings\\txt") Z.matrix<-as.matrix(dat) Y<-dat[,46:63] X<-dat[1,51] dat[1,5

[R] Any simple way to subset a vector of strings that do contain a particular substring ?

2008-06-18 Thread Daren Tan
For example, strings <- c("", "","ccba"). How to get "", "" that do not contain "ba" ? _ [[alternative HTML version deleted]] __ R-help@r-project.org maili

Re: [R] Controlling the length of line with abline(lm())

2008-06-18 Thread Rolf Turner
On 19/06/2008, at 2:09 PM, Tariq Perwez wrote: Hi I just realized that when I use linear regression to draw a line through my data points with something like the following: abline(lm(y ~ x)) the length of the line is infinite, i.e., the line goes beyond the smallest and the largest data

Re: [R] Controlling the length of line with abline(lm())

2008-06-18 Thread Gabor Grothendieck
That's normally how its done so you might want to reconsider whether you really want only the line segment; however, if you insist see ?segments plot(y ~ x) y.lm <- lm(y ~ x) n <- length(x) # x assumed to be in ascending or descending order segments(x[1], fitted(y.lm)[1], x[n], fitted(y.lm)[n])

Re: [R] Complex Time Series

2008-06-18 Thread Spencer Graves
If this were my problem, I think I'd express it as a Kalman filter and use the 'dlm' package. Fortunately, the package contains a vignette. Hope this helps. Spencer Graves Bernardo Rangel Tura wrote: Hi R masters, In my work I analyse a time serie of number of birth in State

[R] try to find the MLE of a function

2008-06-18 Thread Manli Yan
Hi everyone: I have a density function f(x|theta)=theta*x^(theta-1),where 00 in my function. Great thanks for your time~ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] printfing, pasting,writing variables

2008-06-18 Thread Jorge Ivan Velez
Dear Felipe, Is something like this what you are looking for? z=1 plot(rnorm(100),main=paste("The variable is ",z,sep="")) z=5 plot(rnorm(100),main=paste("The variable is ",z,sep="")) HTH, Jorge On Wed, Jun 18, 2008 at 11:30 PM, Felipe <[EMAIL PROTECTED]> wrote: > how can i write in a txt o

[R] printfing, pasting,writing variables

2008-06-18 Thread Felipe
how can i write in a txt or put in a title of a plot or boxplot or something a variable like let's say z=1 and i want my title or a write like this "the variable is 1" if z change the 1 above change understand?? do anyone know?? tks [[alternative HTML version deleted]] __

[R] Controlling the length of line with abline(lm())

2008-06-18 Thread Tariq Perwez
Hi I just realized that when I use linear regression to draw a line through my data points with something like the following: abline(lm(y ~ x)) the length of the line is infinite, i.e., the line goes beyond the smallest and the largest data values. This seems not very right to me (not to mention

Re: [R] The assign function in R

2008-06-18 Thread Duncan Murdoch
Applejus wrote: Hello, I want to convert assign("a", b, where =1 ) from SPLUS to R. Is it safe to assume that the equivalent of where=1 is pos=1 in R? Thanks for help! Only a limited number of users here know what "where=1" means in S-PLUS. If one of those doesn't answer, you might want

Re: [R] multiple multiplication in R

2008-06-18 Thread Jorge Ivan Velez
Dear Manli, Perhaps: x<-c(1,2,3,4,5,6) prod(x) [1] 720 paste(x,collapse="*",sep="") [1] "1*2*3*4*5*6" HTH, Jorge On Wed, Jun 18, 2008 at 7:22 PM, Manli Yan <[EMAIL PROTECTED]> wrote: > hi: just a very simple quesion,how to do multiple multiplication in R > x<-c(1,2,3,4,5,6) > how to g

Re: [R] Custom strips in lattice

2008-06-18 Thread Deepayan Sarkar
On 6/18/08, Jim Price <[EMAIL PROTECTED]> wrote: > > I've recently been playing with strip functions for a data presentation I'd > like to use, and have a couple questions. I've cannibalised the > useOuterStrips function from latticeExtra to give me the following sample > code: > > > > library

Re: [R] Insert raster image into an R graphic

2008-06-18 Thread Gabor Grothendieck
There is some sample code here: http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:translucency On Mon, Jun 16, 2008 at 11:09 PM, Tudor Bodea <[EMAIL PROTECTED]> wrote: > Dear useRs: > > Is there a way to include a raster image (e.g., .gif, .jpg, .bmp) representing > a company logo, a

Re: [R] multiple multiplication in R

2008-06-18 Thread Charles Annis, P.E.
> 1*2*3*4*5*6 [1] 720 Charles Annis, P.E. [EMAIL PROTECTED] phone: 561-352-9699 eFax: 614-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Manli Yan Sent: Wednesday, June 18, 2008 7:22 PM To: r-help@r-pr

Re: [R] multiple multiplication in R

2008-06-18 Thread Erik Iverson
see ?prod Manli Yan wrote: hi: just a very simple quesion,how to do multiple multiplication in R x<-c(1,2,3,4,5,6) how to get 1*2*3*4*5*6? I checked the Arithmetic Operators in R,but did not found the operators for this function,anyway can do this except the loop? [[alternative

[R] multiple multiplication in R

2008-06-18 Thread Manli Yan
hi: just a very simple quesion,how to do multiple multiplication in R x<-c(1,2,3,4,5,6) how to get 1*2*3*4*5*6? I checked the Arithmetic Operators in R,but did not found the operators for this function,anyway can do this except the loop? [[alternative HTML version deleted]] _

Re: [R] Question

2008-06-18 Thread Henrique Dallazuanna
Try this: xtabs(value ~ Grade + location, data = dat) On 6/18/08, Zolfaghari, Arvin <[EMAIL PROTECTED]> wrote: > > Hi list, > I am trying to convert my Data from 1st following format to the second. > Any comment? > > You could copy following in Tinn R > Data<- > data.frame(location=c("postcode"

Re: [R] Pointwise Confidence Bounds on Logistic Regression

2008-06-18 Thread Rolf Turner
On 19/06/2008, at 9:32 AM, Prof Brian Ripley wrote: On Thu, 19 Jun 2008, Rolf Turner wrote: On 19/06/2008, at 8:08 AM, Bryan Hanson wrote: Hi all. I hope I have my terminology right here... For a simple lm, one can add “pointwise confidence bounds” to a fitted line using something like

[R] Complex Time Series

2008-06-18 Thread Bernardo Rangel Tura
Hi R masters, In my work I analyse a time serie of number of birth in State of Rio de Janeiro. After study de ACF e p ACF I conclude the model is: Non seasonal ar(1) In 7 days lag 7 days seasonal ma(1) In 364 days lag 364 days seasonal ma(1) If the time serie was Non seasonal ar(1) with one s

Re: [R] Pointwise Confidence Bounds on Logistic Regression

2008-06-18 Thread Prof Brian Ripley
On Thu, 19 Jun 2008, Rolf Turner wrote: On 19/06/2008, at 8:08 AM, Bryan Hanson wrote: Hi all. I hope I have my terminology right here... For a simple lm, one can add “pointwise confidence bounds” to a fitted line using something like predict(results.lm, newdata = something, interval = "c

Re: [R] Installing R on solaris

2008-06-18 Thread Prof Brian Ripley
On Wed, 18 Jun 2008, Manjit Barman wrote: Hi, I have been trying to install R on solaris 10. i could compile the source files following the steps in R admin.html manual but eventually i don't see the libR.so and libjvm.so file created anywhere. could you please specify me some step by step

[R] Error in bugs.run -- R2WinBUGS

2008-06-18 Thread Cleber Nogueira Borges
Hi, I tried to use MethComp library and this library make use of the WinBUGS by R2WinBuGUS, but I get the follow error in bugs.run: *Error in bugs.run(n.burnin, bugs.directory, WINE = WINE, useWINE = useWINE, : * Look at the log file and try again with 'debug=TRUE' to figure out what went

Re: [R] R perfomance question !!!

2008-06-18 Thread Roland Rau
Hi, diver495 wrote: Using Visual Basic I can complete the same script (simple loop of 500 itterations) in 0.1 sec. Is it realy R not suitable for huge computing. If you are happy with Visual Basic, then there is no need for you to use R. In case your message was not a flamebait, it is well

[R] highest eigenvalues of a matrix

2008-06-18 Thread baptiste Auguié
DeaR list, I happily use eigen() to compute the eigenvalues and eigenvectors of a fairly large matrix (200x200, say), but it seems over-killed as its rank is limited to typically 2 or 3. I sort of remember being taught that numerical techniques can find iteratively decreasing eigenvalues

Re: [R] read.spss {foreign} doesn't work over network?

2008-06-18 Thread Farley, Robert
Sorry, the error was "OTOSOTK" {On The Other Side Of The Keyboard}. Someone renamed one of the subdirectories (60 to 06) and I couldn't see it. Sorry for the bandwidth Robert Farley Metro www.Metro.net -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: T

Re: [R] Pointwise Confidence Bounds on Logistic Regression

2008-06-18 Thread Rolf Turner
On 19/06/2008, at 8:08 AM, Bryan Hanson wrote: Hi all. I hope I have my terminology right here... For a simple lm, one can add “pointwise confidence bounds” to a fitted line using something like predict(results.lm, newdata = something, interval = "confidence") (I'm following DAAG page

Re: [R] R perfomance question !!!

2008-06-18 Thread Rolf Turner
On 19/06/2008, at 2:38 AM, diver495 wrote: I ran the simple script bellow and received shoking Your spelling is pretty shoking too. results. It was complied for about 15 seconds !!! on modern Intel Core Duo computer. i=0; while(i<500) { i=i+1; } Using Visual Basic I can c

Re: [R] R perfomance question !!!

2008-06-18 Thread Ben Bolker
diver495 gmail.com> writes: > > > I ran the simple script bellow and received shoking results. It was complied > for about 15 seconds !!! on modern Intel Core Duo computer. > > i=0; > while(i<500) > { > i=i+1; > } > > Using Visual Basic I can complete the same script (simple loop of 5

[R] Pointwise Confidence Bounds on Logistic Regression

2008-06-18 Thread Bryan Hanson
Hi all. I hope I have my terminology right here... For a simple lm, one can add ³pointwise confidence bounds² to a fitted line using something like >predict(results.lm, newdata = something, interval = "confidence") (I'm following DAAG page 154-155 for this) I would like to do the same thing fo

[R] FRB/US

2008-06-18 Thread Tony Burns
I would like to run the Federal Reserves econometric model on open source software - they sent me the specifications for the model and what is neccessary to run the model on TROLL (which is a commercially available econometric software) I am looking into the feasability of doing this and whether o

Re: [R] Cluster on both categorical and numerical data

2008-06-18 Thread paulandpen
okay, when you cluster information, you can have two inputs raw data information which the algorithms converts have into a matrix and then processes a pre-processed matrix which you create yourself to input into a package essentially, packages will have a default assumption about the data yo

Re: [R] Deming Regression

2008-06-18 Thread Dexter Riley
Ah, great! Thanks for the help. Tom La Bone wrote: > > I believe that Deming regression also goes by the name of orthogonal > regression, which can be performed in R using pca methods. If you do a > search of the list for "orthogonal regression" you can see the previous > discussions of this t

[R] Question

2008-06-18 Thread Zolfaghari, Arvin
Hi list, I am trying to convert my Data from 1st following format to the second. Any comment? You could copy following in Tinn R Data<- data.frame(location=c("postcode","sector","long/lat","sector"),Grade=c(" h","m","L","h"),value=c(2,3,5,6)) #Question: how can I reshape Data to the following #

Re: [R] Deming Regression

2008-06-18 Thread Dexter Riley
Excellent! Thanks very much! Cleber Nogueira Borges wrote: > > Hello Dexter, > > I have interest in this topic! > In my search in web, I find things about the MethComp package! > > In this package, there is a Deming function ... for Deming regression! > > http://staff.pubhealth.ku.dk/~bxc

Re: [R] Insert raster image into an R graphic

2008-06-18 Thread Paul Murrell
Hi Tudor Bodea wrote: > Dear useRs: > > Is there a way to include a raster image (e.g., .gif, .jpg, .bmp) representing > a company logo, a school logo, etc. into an R graphic? For example, it would > be > nice to be able to include the logo of the school into the charts that a > student produce

[R] Custom strips in lattice

2008-06-18 Thread Jim Price
I've recently been playing with strip functions for a data presentation I'd like to use, and have a couple questions. I've cannibalised the useOuterStrips function from latticeExtra to give me the following sample code: library(lattice) myData <- expand.grid( type = c('First 3 days','

[R] Installing R on solaris

2008-06-18 Thread Manjit Barman
Hi, I have been trying to install R on solaris 10. i could compile the source files following the steps in R admin.html manual but eventually i don't see the libR.so and libjvm.so file created anywhere. could you please specify me some step by step instructions for installing R in solaris? That

[R] R perfomance question !!!

2008-06-18 Thread diver495
I ran the simple script bellow and received shoking results. It was complied for about 15 seconds !!! on modern Intel Core Duo computer. i=0; while(i<500) { i=i+1; } Using Visual Basic I can complete the same script (simple loop of 500 itterations) in 0.1 sec. Is it realy R not suita

[R] Histogram inset into another histogram

2008-06-18 Thread Victor Homar
Dear R users and helpers, I'm trying to find an example of a histogram plot as an inset (upper right or left corner) of another histogram. Anyone has an example of that? Thanks for your help, Víctor. -- --- Víctor Homar San

Re: [R] Insert raster image into an R graphic

2008-06-18 Thread Tudor Bodea
Dr. Murrell: Thank you so much for your prompt reply. Tudor Quoting Paul Murrell <[EMAIL PROTECTED]>: > Hi > > > Tudor Bodea wrote: > > Dear useRs: > > > > Is there a way to include a raster image (e.g., .gif, .jpg, .bmp) > representing > > a company logo, a school logo, etc. into an R graphic?

Re: [R] help with manipulating data frames (survey analysis)

2008-06-18 Thread hadley wickham
> I want to do statistical analysis on some survey data and I can specify what > I would like to do very easily in algorithmic terms. However, being a n00b > to R I am struggling with getting R to execute what I want. > > I think all I need is some source that directs me in the right direction by >

Re: [R] help with manipulating data frames (survey analysis)

2008-06-18 Thread Marvin Lists
Thanks, I checked that site out but you are right, that's not what I need. Price isn't an issue for me. I have access to pretty much any book through my library or interlibrary loan. Thanks again, Marvin On Wed, Jun 18, 2008 at 12:23 PM, Patrick Burns <[EMAIL PROTECTED]> wrote: > S Poetry might

Re: [R] help with manipulating data frames (survey analysis)

2008-06-18 Thread Marvin Lists
If you mean: http://cran.r-project.org/doc/manuals/R-intro.pdf I have already gone through that. I has no examples and only introductory text about what data frames are. I am looking for something a bit more comprehensive - perhaps something that uses a scenario or example to illustrate how variou

Re: [R] Maximum Likelihood Estimation

2008-06-18 Thread Ben Bolker
Todd Brauer yahoo.com> writes: > > Using R, I would like to calculate algorithms to estimate coefficients á and â within the gamma function: > f(costij)=((costij)^á)*exp(â*costij).  I have its logarithmic diminishing line data > (Logarithmic Diminishing Line Data Table) and have installed R¢s Ma

Re: [R] help with manipulating data frames (survey analysis)

2008-06-18 Thread stephen sefick
an introduction to R On Wed, Jun 18, 2008 at 2:11 PM, Marvin Lists <[EMAIL PROTECTED]> wrote: > Dear all, > > Can anyone recommend a good book or an online tutorial for using data > frames > in R? > > I want to do statistical analysis on some survey data and I can specify > what > I would like to

Re: [R] Editor for Mac OSX

2008-06-18 Thread Charilaos Skiadas
One more advantage of TextMate is support for Sweave files. You can have a Sweave file open, and the LaTeX parts of it are syntax colored according to LaTeX and one can use all the facilities of the LaTeX extension (bundle) in LaTeX (which probably has some things similar to AucTeX, has a n

[R] help with manipulating data frames (survey analysis)

2008-06-18 Thread Marvin Lists
Dear all, Can anyone recommend a good book or an online tutorial for using data frames in R? I want to do statistical analysis on some survey data and I can specify what I would like to do very easily in algorithmic terms. However, being a n00b to R I am struggling with getting R to execute what

Re: [R] Editor for Mac OSX

2008-06-18 Thread Hans-Jörg Bibiko
On 18.06.2008, at 18:09, Graham Smith wrote: Have a look at TextMate http://macromates.com/ There are three extensions (bundles) available dealing with R for TextMate [up to now in the Review repository]: [in very short terms] 1) R - writing R scripts and executing it (plots are inside as

Re: [R] keeping original order in factor()

2008-06-18 Thread Charles C. Berry
On Wed, 18 Jun 2008, Andrew Yee wrote: Thanks for everyone's suggestions. I think factor(foo, levels = unique(foo)) works best for my needs. (By the way, I'm still trying to figure out how to use the ordered option in factor().) Some functions behave differently if the factor levels are in a

Re: [R] strptime

2008-06-18 Thread Prof Brian Ripley
On Wed, 18 Jun 2008, Eric Elguero wrote: Hi, what's wrong with that? User error. Look up all the terms beginning with % -- the third one (%:) is not described in the help file. strptime("06:00:00 03.01.2008",format="%H:%M%:%S %d.%m.%Y",tz="GMT") [1] NA the command seems to comply wit

Re: [R] Help with axis labels

2008-06-18 Thread Gabor Grothendieck
See ?axTexpr in the sfsmisc package. There are several examples on that page. On Wed, Jun 18, 2008 at 12:59 PM, Tariq Perwez <[EMAIL PROTECTED]> wrote: > Hi > I have patched together (from various sources) the following code to get > semi-logarithmic plot. Unfortunately, my labels come out also a

Re: [R] computing the average and standard deviation for many setsof triplicates, using "R-approach"

2008-06-18 Thread Bert Gunter
Folks: Assuming that you want row statistics of each block, it seems to me that solutions so far proposed are either unnecessarily complex (a matter of personal taste, I know) or depend unnecessarily on the specific arrangement of the columns (with those beginning with same letter occurring togeth

Re: [R] strptime

2008-06-18 Thread Erik Iverson
Eric Elguero wrote: Hi, what's wrong with that? strptime("06:00:00 03.01.2008",format="%H:%M%:%S %d.%m.%Y",tz="GMT") [1] NA the command seems to comply with the rules in the help file But it does not. Look closely at the format, and then you'll see %M%... but returns NA (R 2.6.1 Wind

[R] Help with axis labels

2008-06-18 Thread Tariq Perwez
Hi I have patched together (from various sources) the following code to get semi-logarithmic plot. Unfortunately, my labels come out also at intermediate places between 10^2, 10^3, 10^4 etc. Since I put the code together from various sources and do not understand fully how the code is working, I ha

Re: [R] Editor for Mac OSX

2008-06-18 Thread Markus Gesmann
Smultron http://smultron.sourceforge.net/ is a nice (and free) alternative to the R build in editor. However, I would suggest to send Mac specific questions to the R-Mac mail list: https://stat.ethz.ch/mailman/listinfo/r-sig-mac Best regards, Markus Markus Gesmann │Associate Director│Libero V

[R] strptime

2008-06-18 Thread Eric Elguero
Hi, what's wrong with that? strptime("06:00:00 03.01.2008",format="%H:%M%:%S %d.%m.%Y",tz="GMT") [1] NA the command seems to comply with the rules in the help file but returns NA (R 2.6.1 Windows XT) Eric Elguero __ R-help@r-project.org mailing li

[R] Maximum Likelihood Estimation

2008-06-18 Thread Todd Brauer
Using R, I would like to calculate algorithms to estimate coefficients á and â within the gamma function: f(costij)=((costij)^á)*exp(â*costij).  I have its logarithmic diminishing line data (Logarithmic Diminishing Line Data Table) and have installed R¢s Maximum Likelihood Estimation package; ho

Re: [R] Editor for Mac OSX

2008-06-18 Thread Thomas Adams
Sebastian, You may also want to look at BBEdit (http://www.barebones.com/). Welcome to Macintosh! Regards, Tom Sebastian Leuzinger wrote: Dear R-list I am (forced) to change from Linux to Mac and am now looking for a new editor for R. I would like one that features a split window (console +

Re: [R] inverse cumsum

2008-06-18 Thread Alfredo Alessandrini
> i guess you mean columnwise cumsums computed starting from the bottom up? yes > then this should do (given that your data is in matrix m, and years are > row labels, not data): > > rc = nrow(m) > cumsums = apply(m[rc:1,], 2, cumsum)[rc:1,] ok...work very well.. >data 1987 1.33 1.21

Re: [R] computing the average and standard deviation for many sets of triplicates, using "R-approach"

2008-06-18 Thread hadley wickham
On Wed, Jun 18, 2008 at 9:17 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > Below example has 4 sets of triplicates, without using for loop and > iteratively cbind the columns, what is the "R-approach" of generating a > matrix of 8 columns that are the averages and standard deviations ? The > aver

[R] Small Bug in constrOptim documentation

2008-06-18 Thread Matthias Gondan
Dear list, I think there is a small bug in the constrOptim documentation (R-2.7.0): ## from optim fr <- function(x) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 } grr <- function(x) { ## Gradient of 'fr' x1 <- x[1] x2 <- x[2]

[R] Transform data to uniform variates

2008-06-18 Thread Aloui Riadh
To estimate Copula using canonical maximum likelihood method we need first tranforming data to uniform variates. I found this code written by Jun Yan: cbind((rank(dat[, 1]) - 0.5)/n, (rank(dat[, 2]) - 0.5)/n) where dat represent the considered data. Why do not use this formula rank(dat)/(n+1) is

[R] Build a R into a single static library on windows?

2008-06-18 Thread Chen, Zehao
> Hi R users, > > I've been developing a C++ library that depends on R through R.dll. > The current way is to have R directories somewhere and have R_HOME > pointing to it. This works. But it's inconvenient when deploying this > library since the whole R distribution has to be deployed with it. >

Re: [R] Editor for Mac OSX

2008-06-18 Thread Graham Smith
Have a look at TextMate http://macromates.com/ Graham 2008/6/18 Sebastian Leuzinger <[EMAIL PROTECTED]>: > Dear R-list > I am (forced) to change from Linux to Mac and am now looking for a new > editor for R. I would like one that features a split window (console + > editor) as well as syntax hi

Re: [R] Editor for Mac OSX

2008-06-18 Thread Erik Iverson
Sebastian Leuzinger wrote: Dear R-list I am (forced) to change from Linux to Mac and am now looking for a new editor for R. I would like one that features a split window (console + editor) as well as syntax highlighting. Can anyone help? Especially the split-window feature does not seem to be e

[R] unscribe

2008-06-18 Thread dong kim
MIME-Version: 1.0 Content-Type: text/plain; charset=euc-kr Content-Transfer-Encoding: quoted-printable Hello,=0A=0AIt doesn't seem to work for me when I was trying to unsubscribe= R-help mailing list (I did not get confirmation email). =0ACould you pleas= e unsubscribe me from the mail list subsc

Re: [R] computing the average and standard deviation for many sets of triplicates, using "R-approach"

2008-06-18 Thread stephen sefick
#is this what you want? t <- matrix(rnorm(120), ncol=12) (colnames(t) <- paste(rep(LETTERS[1:4], each=3), 1:3, sep=".")) f<-as.matrix(cbind(c(t[,1:3]), c(t[,4:6]), c(t[7:9]), c(t[10:12]))) colnames(f)<-paste(rep(LETTERS[1:4])) library(prettyR) describe(f, num.desc=c("mean", "sd")) On Wed, Jun 18,

Re: [R] x labels out of Quartz canvas

2008-06-18 Thread MeMooMeM
Dr. Ripley, I appreciate all your help. The graph looks great now. Just in case someone searches for a similar problem: >You need to set the *margins* not the size of the canvas. See par's mai >and mar and the figures in that document. Here's how I do that: par(mar=c(7,7,7,7)) color2D.matplot

Re: [R] operations on all pairs of columns from two matrices

2008-06-18 Thread Stephen Tucker
how about this? m1 <- matrix(rep(1:3,each=5),ncol=3) m2 <- matrix(1:15,ncol=3) array(apply(m1,2,function(x,m) m-x,m2),dim=c(dim(m2),ncol(m1))) - Original Message From: Daren Tan <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Wednesday, June 18, 2008 7:36:45 AM Subject: [R] operations

[R] Editor for Mac OSX

2008-06-18 Thread Sebastian Leuzinger
Dear R-list I am (forced) to change from Linux to Mac and am now looking for a new editor for R. I would like one that features a split window (console + editor) as well as syntax highlighting. Can anyone help? Especially the split-window feature does not seem to be easily available in the edito

Re: [R] How to create strata out of the data.frame table

2008-06-18 Thread hadley wickham
On Wed, Jun 18, 2008 at 9:20 AM, Ana Kolar <[EMAIL PROTECTED]> wrote: > My data.frame table consist of 3 variables (x,y and z) where each variable > has 1000 units. I need to create 5 equal size strata according to one of the > variable (let's say x) whereas units of x variable with a higher value

Re: [R] attention plot

2008-06-18 Thread Gabor Grothendieck
Perhaps gplot from sna package? library(gplot) gplot(rgraph(5), vertex.sides = 4, vertex.cex = 1:5, vertex.col = 1:5) On Wed, Jun 18, 2008 at 9:53 AM, Michael Schulte <[EMAIL PROTECTED]> wrote: > Dear all, > > I am looking for a method to draw multiple rectangles in different colors > plus arrow

Re: [R] computing the average and standard deviation for many sets of triplicates, using "R-approach"

2008-06-18 Thread Henrique Dallazuanna
Try this: f <- function(x) { sub <- subset(t, select = x) cbind(Mean = rowMeans(sub, na.rm = T), Sd = apply(sub, 1, sd, na.rm = T)) #return(sub) } do.call(cbind, lapply(lapply(seq(1, ncol(t), by = ncol(t)/4), seq, l = 3), f)) On Wed, Jun 18, 2008 at 11:17 AM, Daren Tan <[EMAIL PROT

[R] operations on all pairs of columns from two matrices

2008-06-18 Thread Daren Tan
m1 <- matrix(rnorm(40), ncol=4) m2 <- matrix(rnorm(40), ncol=4) I would like to subtract first column of m1 from all columns of m2, subtract 2nd of m1 from all columns of m2, and so on. Obviously, I am not using the appropriate function outer(m1, m1, "-"), since the first column isn't all 0s

[R] How to create strata out of the data.frame table

2008-06-18 Thread Ana Kolar
My data.frame table consist of 3 variables (x,y and z) where each variable has 1000 units. I need to create 5 equal size strata according to one of the variable (let's say x) whereas units of x variable with a higher value have higher probability to be selected in a strata with a higher number (max

[R] computing the average and standard deviation for many sets of triplicates, using "R-approach"

2008-06-18 Thread Daren Tan
Below example has 4 sets of triplicates, without using for loop and iteratively cbind the columns, what is the "R-approach" of generating a matrix of 8 columns that are the averages and standard deviations ? The average and standard deviation columns should be side by side i.e. A.mean A.sd B.me

Re: [R] Deming Regression

2008-06-18 Thread Cleber Nogueira Borges
Hello Dexter, I have interest in this topic! In my search in web, I find things about the MethComp package! In this package, there is a Deming function ... for Deming regression! http://staff.pubhealth.ku.dk/~bxc/MethComp/Archive/ http://staff.pubhealth.ku.dk/~bxc/MethComp/ Cleber Hi all.

[R] attention plot

2008-06-18 Thread Michael Schulte
Dear all, I am looking for a method to draw multiple rectangles in different colors plus arrows between them (given a data matrix with the relevant coordinate and size information). After looking around mainly on: http://cran.r-project.org/web/views/Graphics.html and the Rseek page the Grid p

r-help@r-project.org

2008-06-18 Thread Gustaf Rydevik
On Wed, Jun 18, 2008 at 3:10 PM, Christos Argyropoulos <[EMAIL PROTECTED]> wrote: > > Hi, > > I noticed whether some one could explain why "&" and "&&" behave differently > in data frame transformations. > > Consider the following : > > a<-data.frame(r=c(0,0,2,3),g=c(0,2,0,2.1)) > > Then: > >> tra

Re: [R] Extract only certain rows from a table

2008-06-18 Thread Henrique Dallazuanna
Try: subset(tb, ID %in% vec) On Wed, Jun 18, 2008 at 10:36 AM, <[EMAIL PROTECTED]> wrote: > Hi, > > I have a table where column 1 has ID numbers and column two has data, and I > have > a vector containing a subset of those ID numbers. How can I create a new > table > with only the rows from the

r-help@r-project.org

2008-06-18 Thread Toby Marthews
Hi there, Simplifying your example a bit, we have: > a=data.frame(r=c(0,0,1,1),g=c(0,1,0,1)) > transform(a,R=(r>0 && g>0)) r g R 1 0 0 FALSE 2 0 1 FALSE 3 1 0 FALSE 4 1 1 FALSE > transform(a,R=(r>0 & g>0)) r g R 1 0 0 FALSE 2 0 1 FALSE 3 1 0 FALSE 4 1 1 TRUE > ...but actually, in th

[R] Extract only certain rows from a table

2008-06-18 Thread naw3
Hi, I have a table where column 1 has ID numbers and column two has data, and I have a vector containing a subset of those ID numbers. How can I create a new table with only the rows from the old table that match the IDs in the vector, like below: Original Table: ID Value 1123 2

[R] PCA analysis

2008-06-18 Thread Monica Pisica
Monna, The way i do it is to re-create the biplot for the PCA . I am attaching my code (i am sure this can be done even easier . but this works as well) where i am using pca() function from labdsv and my data is called veg1. library (labdsv) pca.1<-pca(veg1,cor=TRUE) # The scores are

Re: [R] Differential Equations

2008-06-18 Thread Spencer Graves
I just got 37 hits from RSiteSearch('differential equation', 'fun') including odesolv{fda}, rk4{deSolve}, rk4{odesolve}, in addition to lsoda{odesolve} and the Rsundials package. hope this helps. Spencer Graves Michael Lawrence wrote: On Tue, Jun 17, 2008 at 6:25 PM, David Ar

[R] reformatting R scripts for htmlize()

2008-06-18 Thread Agustin Lobo
Hi! I have a bunch of (mainly class) R scripts that I would like to convert into html pages (although if someone thinks that what I want to do is easier with latex or pdf, please tell me). Considering the format of my files, htmlize() seems the best option. The only problem is that I would need

Re: [R] paste data

2008-06-18 Thread Ido M. Tamir
>I want to do very similar things with all the dataframes and their structure >is also the same. >Is there a way to write a loop? (so that I don't have to write the same 18 >times) >I tried things like that: >for (x in 1:length(plot)) >{ > plot(paste("auto.",plot[x],sep="")[,1], > pas

Re: [R] combining two data frames (different question)

2008-06-18 Thread [EMAIL PROTECTED]
Try > ?merge Andrey __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Scoring Leads / Regression

2008-06-18 Thread ajay ohri
Hi List, Has anyone used R for scoring leads. What has been your experience. I know the GLM function, but any other functions would help . Also I have tried the R GUI's rattle and R Cmdr ( a bit pressed for time and regression statistics ). What would be the best way to go about building this mod

[R] example from arfimaOxFit

2008-06-18 Thread Chang, Li-Wei
Hi, I got some problem running the example of arfimaOxFit. The first three line of the examples I run are: library(Rmetrics) x = armaSim(model = list(ar = c(0.5, - 0.5), d = 0.3, ma = 0.1), n = 500) fit = arfimaOxFit(formula = x ~ arfima(2,1)) The error msg is: Error in eval(expr, envir, enclos) :

Re: [R] paste data

2008-06-18 Thread Ray Brownrigg
get() is your friend. Try: for (x in 1:length(plot)) { thisdf <- paste("auto.", plot[x], sep="") plot(thisdf[, 1], thisdf[, 2], col=...) } HTH, Ray Brownrigg Sybille Wendel wrote: Hello, I need a command. I have a lot of data in different dataframes(auto.0a, auto.0b, auto.0c,

r-help@r-project.org

2008-06-18 Thread Christos Argyropoulos
Hi, I noticed whether some one could explain why "&" and "&&" behave differently in data frame transformations. Consider the following : a<-data.frame(r=c(0,0,2,3),g=c(0,2,0,2.1)) Then: > transform(a,R=ifelse(r>0 && g> 0,log(r/g),NA)) r g R 1 0 0.0 NA 2 0 2.0 NA 3 2 0.0 NA 4 3 2.1 NA

Re: [R] Deming Regression

2008-06-18 Thread Tom La Bone
I believe that Deming regression also goes by the name of orthogonal regression, which can be performed in R using pca methods. If you do a search of the list for "orthogonal regression" you can see the previous discussions of this topic. Tom Dexter Riley wrote: > > Hi all. Has anyone ever do

Re: [R] Plot point patterns

2008-06-18 Thread Roger Bivand
Vanesa Maria Santos Sanchez alum.uca.es> writes: > > > Hello! > I want to plot a multitype point pattern called "new" in package > spatstat. When I write plot(new) in the graphic window I can see a > strech rectangle with a point inside, not the point pattern.If I > write plot(new$x,new$y) t

  1   2   >