[R] nls() and numerical integration (e.g. integrate()) working together?

2007-08-23 Thread Michael Lindner
Dear List-Members, since 3 weeks I have been heavily working on reproducing the results of an economic paper. The method there uses the numerical solution of an integral within nonlinear least squares. Within the integrand there is also some parameter to estimate. Is that in the end possible to

Re: [R] nls() and numerical integration (e.g. integrate()) workingtogether?

2007-08-23 Thread Frede Aakmann Tøgersen
Michael, it should be possible to get nls and integrate to work together. Bt, there are several problems you need to consider first. The most important is the definition of e.g. your f-function and how integrate() work. The easiest way to show you the problem is like in the following. The

[R] Histogram

2007-08-23 Thread squall44
Hello, I wanted to create a histogram, but somehow I got stuck... The interval limits are: x = 1, 2, 3, 3.5, 4.5, 5, 5.5 The interval widths are therefore: 1, 1, 0.5, 1, 0.5, 0.5 Nothing I tried worked... Can anyone help me please? Thanks Tobias -- View this message in context:

[R] Two graphs, align vertically

2007-08-23 Thread squall44
Hi, I created an ecdf and a boxplot. Now I would like to place the ecdf above the boxplot. But I only managed to align them horizontally. I used this code: #--- par(mfrow=c(1,2), mar=c(5,3,3,1)) # ecdf library(plotrix) x =

[R] Estimate Intercept in ARIMA model

2007-08-23 Thread doublelin15
Hi, All, This is my program ts1.sim - arima.sim(list(order = c(1,1,0), ar = c(0.7)), n = 200) ts2.sim - arima.sim(list(order = c(1,1,0), ar = c(0.5)), n = 200) tdata-ts(c(ts1.sim[-1],ts2.sim[-1])) tre-c(rep(0,200),rep(1,200)) gender-rbinom(400,1,.5) x-matrix(0,2,400) x[1,]-tre x[2,]-gender fit

Re: [R] Two graphs, align vertically

2007-08-23 Thread Uwe Ligges
squall44 wrote: Hi, I created an ecdf and a boxplot. Now I would like to place the ecdf above the boxplot. But I only managed to align them horizontally. I used this code: #--- par(mfrow=c(1,2), mar=c(5,3,3,1)) As in the message before: Please

Re: [R] Histogram

2007-08-23 Thread Uwe Ligges
squall44 wrote: Hello, I wanted to create a histogram, but somehow I got stuck... The interval limits are: x = 1, 2, 3, 3.5, 4.5, 5, 5.5 The interval widths are therefore: 1, 1, 0.5, 1, 0.5, 0.5 Please read the help page more carefully! See ?hist and its argument breaks. Uwe Ligges

Re: [R] two labels on x-axis (year and month)

2007-08-23 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: hej i'm plotting time-series and label the x-axis as follows: r - as.POSIXct(round(range(p1$time), month)) to define the time range for labeling the xaxis plot(p1$time,p1$ p1, type=l, xaxt=n) plots p1 against time axis.POSIXct(1, at=seq(r[1], r[2],

Re: [R] Histogram

2007-08-23 Thread squall44
Well, that was the first thing I tried. But the help only gives you the commands and does not explain how to use it (I am a newbe). How do I use the argument 'breaks'? I tried: #--- x = c(1, 2, 3, 3.5, 4.5, 5, 5.5) breaks=c(1, 1, 0.5, 1, 0.5, 0.5) hist(x, breaks= breaks, xlim=c(0,7),

Re: [R] Two graphs, align vertically

2007-08-23 Thread squall44
Thanks for you answer Uwe, I have the code par(mfrow=c(1,2), mar=c(5,3,3,1)) not from the help, but from an example from the R Graph Gallery. I think the help is rather useless for beginners (like me), because it does not explain anything and only gives the commands. Anyway, I always try first

Re: [R] Histogram

2007-08-23 Thread Uwe Ligges
squall44 wrote: Well, that was the first thing I tried. But the help only gives you the commands and does not explain how to use it (I am a newbe). How do I use the argument 'breaks'? I tried: #--- x = c(1, 2, 3, 3.5, 4.5, 5, 5.5) breaks=c(1, 1, 0.5, 1, 0.5, 0.5) hist(x, breaks=

Re: [R] Estimate Intercept in ARIMA model

2007-08-23 Thread Prof Brian Ripley
This is described on the help page! include.mean: Should the ARIMA model include a mean term? The default is 'TRUE' for undifferenced series, 'FALSE' for differenced ones (where a mean would not affect the fit nor predictions). Further, if 'include.mean' is true, this

[R] Choice of data.frame column by index?

2007-08-23 Thread Johannes Graumann
Hello, Imagine a data frame like so: Intensity0 Intensity1 1 767432.1 451743.4 2 3998988.0 4642145.0 3 818974.6 552315.8 and a vector like so: [1] 1 2 1 How can I get R to produce a vector that contains the value in one column or the other depending on the vector? The result

[R] How to fit an linear model withou intercept

2007-08-23 Thread Michal Kneifl
Please could anyone help me? How can I fit a linear model where an intercept has no sense? Thanks in advance.. Michael __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Newbie Question: Using R with PHP and MySQL

2007-08-23 Thread MASFERFC Team
First, I should admit that I didn't do a lot of searching beforehand, I'm just cutting to the chase to ask the experts: I'm currently running MySQL 5 queries with PHP 5.2.3 and returning results to the end-user in web-page tables of ca. 50 rows by 5 columns. I'd like to (more or less)

[R] Wrapper Subset Selection

2007-08-23 Thread Vu Nguyen
Hello -- Is there any R function that implements Wrapper Subset Selection method? I am using 'leaps' package, and I do not know if 'leaps' works better than Wrapper. Thanks, Vu __ R-help@stat.math.ethz.ch mailing list

[R] Splitting strings

2007-08-23 Thread Gary Collins
I'm having a Thursday morning mental block, any suggestions on the following would be most appreciated... I have (as an example) surgery = c(d48, d67, dnc37, a75, d10, a78, d31, d55, d1) before each number part the possibilities are c(a, d, dnc), I'm trying to split each element in

Re: [R] Choice of data.frame column by index?

2007-08-23 Thread Johannes Graumann
Thanks! Joh On Thursday 23 August 2007 12:01:50 you wrote: x[cbind(1:nrow(x), the.vector)] Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) Johannes Graumann wrote: Hello, Imagine a data frame like

Re: [R] How to fit an linear model withou intercept

2007-08-23 Thread Michael Dewey
At 10:56 23/08/2007, Michal Kneifl wrote: Please could anyone help me? How can I fit a linear model where an intercept has no sense? Well the line has to have an intercept somewhere I suppose. If you use the site search facility and look for known intercept you will get some clues. Thanks in

Re: [R] How to fit an linear model withou intercept

2007-08-23 Thread David Barron
A number of alternatives, such as: lm(y ~ 0 + x) lm(y ~ x -1) See ?formula On 8/23/07, Michal Kneifl [EMAIL PROTECTED] wrote: Please could anyone help me? How can I fit a linear model where an intercept has no sense? Thanks in advance.. Michael

Re: [R] Splitting strings

2007-08-23 Thread Dimitris Rizopoulos
one way is the following: data.frame(status = gsub([0-9], , surgery), time = gsub([a-z], , surgery)) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven,

Re: [R] How to fit an linear model withou intercept

2007-08-23 Thread John Kane
?lm Details A formula has an implied intercept term. To remove this use either y ~ x - 1 or y ~ 0 + x. See formula for more details of allowed formulae. Is this what you want? --- Michal Kneifl [EMAIL PROTECTED] wrote: Please could anyone help me? How can I fit a linear model where

Re: [R] How to fit an linear model withou intercept

2007-08-23 Thread Ted Harding
On 23-Aug-07 09:56:33, Michal Kneifl wrote: Please could anyone help me? How can I fit a linear model where an intercept has no sense? Thanks in advance.. Michael Presumably you mean where a non-zero intercept has no sense? Suppose the model you want to fit is like Response ~ B+C+X+Y

[R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread John Kane
The FAQ Section 7 is a very useful place for new users to find out any number of R idiosycracies. However there is no numbering on the FAQ Table of Content or on the Sections Tables of Contents. An R-help list reply of Read FAQ 7.10 in response to a question about converting a factor to numeric

Re: [R] Splitting strings

2007-08-23 Thread Gabor Grothendieck
This applies the indicated perl-style regular expression where the first backreference (\\D+) is the non-digits and the second backreference (\\d+) is the digits. The two backreferences, but not the entire matched pattern itself, are passed as arguments x and y to the function whose body is the

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread Gabor Grothendieck
Note that googling R FAQ 7.10 will get it on the first hit. On 8/23/07, John Kane [EMAIL PROTECTED] wrote: The FAQ Section 7 is a very useful place for new users to find out any number of R idiosycracies. However there is no numbering on the FAQ Table of Content or on the Sections Tables

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread John Kane
--- Gabor Grothendieck [EMAIL PROTECTED] wrote: Note that googling R FAQ 7.10 will get it on the first hit. True, however this is not exactly a self-contained solution if one is actually trying to use the FAQ. I may be old fashioned but when directed to the FAQ I tend to go to the FAQ

Re: [R] Help with vector gymnastics

2007-08-23 Thread Eik Vettorazzi
try 5*which(tf)[cumsum(tf)] Gladwin, Philip schrieb: Hello, What is the best way of solving this problem? answer - ifelse(tf=TRUE, i * 5, previous answer) where as an initial condition tf[1] - TRUE For example if, tf - c(T,F,F,F,T,T,F) over i = 1 to 7 then the output of the

[R] Optimal Asset Allocation with a specific level of Target Risk

2007-08-23 Thread massimiliano\.talarico
Dear All, I would like to know if it is possible to obtain the optimal asset allocation with the fPortfolio library (or others), but setting at the beginning a desired level of Target Risk. For example I can obtain the optimal asset allocation with fPortfolio library or portfolio.optim()

[R] Lost in substitute: nlsList and nlme with dynamic formula

2007-08-23 Thread Dieter Menne
DeaR I am trying to use a dynamically create formula with nlsList and nlme, but I cannot get the environment of the string-generated formal to work similarly to the manually entered one. Any idea? Dieter #- library(nlme) # Pinheiro/Bates p 280 fm1Indom.lis =

[R] figure-definition and heatmap question

2007-08-23 Thread Antje
Hello, I have two questions. I'd like to visualize data with a heatmap and I have the following testcase: x - rnorm(256) nx - x + abs(min(x)) nnx - 255/max(nx) * nx x - matrix(nnx, 16, 16) rownames(x) - c(A,B,C,D,E,F,G,I,H,J,K,L,M,N,O,P) par(fin=c(8.0,8.0)) cp -

[R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread mgilgen
i'm trying to convert a zoo object of the following specifications: str(z) atomic [1:15642] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, index)='POSIXct', format: chr [1:15642] 2004-09-01 02:00:00 2004-09-01 03:00:00 2004-09-01 04:00:00 2004-09-01 05:00:00 ... - attr(*, frequency)= num 0.000278 to

Re: [R] Newbie Question: Using R with PHP and MySQL

2007-08-23 Thread Dieter Menne
MASFERFC Team masferfc at gmail.com writes: I'm currently running MySQL 5 queries with PHP 5.2.3 and returning results to the end-user in web-page tables of ca. 50 rows by 5 columns. I'd like to (more or less) simultaneously return to the browser a couple of canned charts and graphs based on

Re: [R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread Achim Zeileis
On Thu, 23 Aug 2007 [EMAIL PROTECTED] wrote: i'm trying to convert a zoo object of the following specifications: str(z) atomic [1:15642] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, index)='POSIXct', format: chr [1:15642] 2004-09-01 02:00:00 2004-09-01 03:00:00 2004-09-01 04:00:00 2004-09-01

[R] weighted nls and confidence intervals

2007-08-23 Thread Joerg van den Hoff
for unweighted fits using `nls' I compute confidence intervals for the fitted model function by using: #--- se.fit - sqrt(apply(rr$m$gradient(), 1, function(x) sum(vcov(rr)*outer(x,x luconf - yfit + outer(se.fit, qnorm(c(probex, 1 - probex))) #--- where `rr'

Re: [R] How to fit an linear model withou intercept

2007-08-23 Thread John Sorkin
Michael, Assuming you want a model with an intercept of zero, I think we need to ask you why you want an intercept of zero. When a normal regression indicates a non-zero intercet, forcing the regression line to have a zero intercept changes the meaning of the regression coefficients. If for

Re: [R] Need a variant of rbind for datasets with different numbers of columns

2007-08-23 Thread hadley wickham
You might try rbind.fill in the reshape package. Hadley On 8/22/07, Kirsten Beyer [EMAIL PROTECTED] wrote: Hello. I am looking for a function that will allow me to paste rows together without regard for the numbers of columns in the datasets to be joined. The only columns where it matters

[R] Output display problem

2007-08-23 Thread Upasna Sharma
Hi I have used the hetcor function on dataset which consists of about 40 variables. Since the output is quite large entire output is not visible on the R screen. Is there a way, I can retrieve the output that is not visible? Thank you Regards Upasna --

Re: [R] degrees of freedom question

2007-08-23 Thread Douglas Bates
On 8/22/07, Greg Tarpinian [EMAIL PROTECTED] wrote: R2.3, WinXP Dear all, I am using the following functions: f1 = Phi1+(Phi2-Phi1)/(1+exp((log(Phi3)-log(x))/exp(log(Phi4))) f2 = Phi1+(Phi2-Phi1)/(1+exp((log(Phi3)-log(r)-log(x))/exp(log(Phi4))) subject to the residual weighting

[R] extracting duplicated elements

2007-08-23 Thread dxc13
Can anyone help me solve this problem...thanks! Consider a data frame, namely v, as such: v X1 X2 X3 X4 X5 X1 X2 X3 X4 X5 x1 1 2 -1 -1 -1 1 2 -1 -1 -1 y1 1 2 -1 -1 -1 1 2 3 -1 -1 What I would like to do is to create an array or data frame with only the elements that appear in the

Re: [R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread Marc Gilgen
Thanks for the inputs, but it's not exactly what I want... My problem is, that my timeseries (precipitation) contain lots of NA-values and when I apply the code: z- data.frame(a=p1$time.date, precip=p1$m1) #gives a dataframe with precipitation and time (2004-01-01 02:12:00) z-

Re: [R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread Achim Zeileis
On Thu, 23 Aug 2007, Marc Gilgen wrote: Thanks for the inputs, but it's not exactly what I want... You did not provide sufficient information. In particular, you still do not provide a small reproducible example. My problem is, that my timeseries (precipitation) contain lots of NA-values

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread Prof Brian Ripley
On Thu, 23 Aug 2007, John Kane wrote: The FAQ Section 7 is a very useful place for new users to find out any number of R idiosycracies. However there is no numbering on the FAQ Table of Content or on the Sections Tables of Contents. Hmm, doc/FAQ does have a numbered table of contents and

Re: [R] extracting duplicated elements

2007-08-23 Thread Gabor Grothendieck
Try: lapply(as.data.frame(t(DF)), function(x) unique(x[duplicated(x) x 0])) On 8/23/07, dxc13 [EMAIL PROTECTED] wrote: Can anyone help me solve this problem...thanks! Consider a data frame, namely v, as such: v X1 X2 X3 X4 X5 X1 X2 X3 X4 X5 x1 1 2 -1 -1 -1 1 2 -1 -1 -1 y1 1

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread Duncan Murdoch
On 8/23/2007 11:28 AM, Prof Brian Ripley wrote: On Thu, 23 Aug 2007, John Kane wrote: The FAQ Section 7 is a very useful place for new users to find out any number of R idiosycracies. However there is no numbering on the FAQ Table of Content or on the Sections Tables of Contents. Hmm,

Re: [R] Stacked Bar

2007-08-23 Thread Greg Snow
Deb, Others have answered your question, I just want to give you something else to think about. Stacked bar plots may not be the best tool to use for this situation, they are ok for comparing the bottom and top groups, but all the other groups don't line up in a stacked bar plot making those

[R] state map question

2007-08-23 Thread Smith, Phil (CDC/CCID/NCIRD)
Hi R-Help: I want to produce a map of the US with different colors for selected states. I installed the map package, and then used: library(maps) I can see that by using map( 'state' ) you get the state boundaries, also. How do I fill in different colors for the different states? I see

Re: [R] divided scatter plots

2007-08-23 Thread Greg Snow
Does the following code do something like what you want (but with the built in data): plot(as.integer(state.region), state.x77[,'Murder'], + xaxt='n', xlim=c(0,5), col=as.integer(state.region)) axis(1, at=1:4, labels=levels(state.region)) oo - order(order( as.integer(state.region),

[R] Change tick mark value in sm.survival()

2007-08-23 Thread Rachel Jia
Hi, I am using this sm.survival() to plot smoothed survival curve against a single continuous covariate. I did a logarithmic transformation on the covariate. Now in the plot, I want the tick mark value to be transformed back to original values. For instance, my current x axis tick mark values

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread Michael A. Miller
John == John Kane [EMAIL PROTECTED] writes: Apologies for the poor quality of the screen capture. I think the first one is a screen cap of http://cran.r-project.org/doc/FAQ/R-FAQ.html. Is that correct? The faq that is part of the r-doc-html package from Debian also has the same bulleted

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread John Kane
Thank you Duncan. That is exactly what I meant. The next level (for example, after clicking on R Miscellanea) should also have numbers. Whether or not it's possible in html as implimented on the R website is another matter of course. --- Duncan Murdoch [EMAIL PROTECTED] wrote: On 8/23/2007

[R] ordered factors in data.frame

2007-08-23 Thread Birgit Lemcke
Hello I need a tiny peace of help. (PPC Mac Os X 10.4.10; R 2.5.1) I have a data.frame with numeric and factor variables. I would like to convert same of the factors to ordered factors. I tried with: attach (table) as.ordered (V3) but this gives me only the V3 Vector as ordred back but in the

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread John Kane
Yes that is it. Thanks --- Michael A. Miller [EMAIL PROTECTED] wrote: John == John Kane [EMAIL PROTECTED] writes: Apologies for the poor quality of the screen capture. I think the first one is a screen cap of http://cran.r-project.org/doc/FAQ/R-FAQ.html. Is that correct? The

[R] Exact Confidence Intervals for the Ration of Two Binomial

2007-08-23 Thread Antonio_Paredes
Hello everyone, I will like to know if there is an R package to compute exact confidence intervals for the ratio of two binomial proportions. Tony. [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

[R] gWidgets (tcltk): problem extracting values from widgets in glayout grid

2007-08-23 Thread englund . evan
Thanks, John. That works... The following is a trivial but complete application that uses glayout to position the widgets, then lets you edit a parameter and execute a function that uses the parameter: ## ### glayout example wtesta = gwindow(Sample

[R] .Call and to reclaim the memory by allocVector

2007-08-23 Thread Yongchao Ge
Hi, I am not sure if this is a bug and I apologize if it is something I didn't read carefully in the R extension manual. My initial search on the R help and R devel list archive didn't find useful information. I am using .Call (as written in the R extension manual) for the C code and have

[R] read big text file into R

2007-08-23 Thread Yupu Liang
Dear Rs: Hi, I am trying to read a big text file (nrows=243440, ncols=144). It seems the computational time of all the read methods (scan,readtable,read.delim) is not linear to the number of rows I want to read in: things became really slow once I tried to read in 10 lines compare to

[R] R old versions archive anywhere?

2007-08-23 Thread Ted Harding
Hi Folks, Does anyone know if (apparently not on CRAN) there is any archive of older versions of R packages? Or is it the case that not only are old versions on CRAN humanesly destoyed, but all older versions out in the wild are hunted down and shot? (I can find older versions of the R core,

[R] Error building R 2-5.2.1 on Sun Solaris 8

2007-08-23 Thread Mike Box
As shown below, the build process fails with only vague messages, leaving me clueless as to how to resolve. Thanks, in advance, for any help that you may offer. Mike -- # ./configure --prefix=/SOURCES/R-2.5.1 --with-iconv=no ... ... ... R is now configured

Re: [R] ordered factors in data.frame

2007-08-23 Thread Greg Snow
The attach function only attachs a copy of the data (changes to the data don't show up in the attached copy). Also you need to tell R what to do with the result of as.ordered (where to save it). Try something like: table$V3 - as.ordered(table$V3) Or table - transform(table,

[R] How to merge string to DF

2007-08-23 Thread Lauri Nikkinen
#Hi R-users, #I have an example DF like this: y1 - rnorm(10) + 6.8 y2 - rnorm(10) + (1:10*1.7 + 1) y3 - rnorm(10) + (1:10*6.7 + 3.7) y - c(y1,y2,y3) x - rep(1:3,10) f - gl(2,15, labels=paste(lev, 1:2, sep=)) g - seq(as.Date(2000/1/1), by=day, length=30) DF - data.frame(x=x,y=y, f=f, g=g) DF$wdays

[R] Rows overlapped each other

2007-08-23 Thread juliocnunes
__ R-help@stat.math.ethz.ch 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.

Re: [R] read big text file into R

2007-08-23 Thread Charles C. Berry
On Thu, 23 Aug 2007, Yupu Liang wrote: Dear Rs: Hi, I am trying to read a big text file (nrows=243440, ncols=144). It seems the computational time of all the read methods (scan,readtable,read.delim) is not linear to the number of rows I want to read in: things became really slow once I

Re: [R] read big text file into R

2007-08-23 Thread Gabor Grothendieck
Another option is to read it into a database and from there into R. RSQLite has the capability of reading certain text files directly into an SQLite database without going through R and from there one can read it into R. You can use RSQLite to do that. Alternately this post describes how the

Re: [R] R old versions archive anywhere?

2007-08-23 Thread Thomas Lumley
On Thu, 23 Aug 2007, [EMAIL PROTECTED] wrote: Hi Folks, Does anyone know if (apparently not on CRAN) there is any archive of older versions of R packages? Yes. On CRAN. At the bottom of the page listing all the packages there is a section - Related Directories Archive

Re: [R] Exact Confidence Intervals for the Ration of Two Binomial

2007-08-23 Thread Charles C. Berry
On Thu, 23 Aug 2007, [EMAIL PROTECTED] wrote: Hello everyone, I will like to know if there is an R package to compute exact confidence intervals for the ratio of two binomial proportions. Probably not. This is a tricky business as the references below make clear. To wit, small sample

[R] Calculating diameters of cirkels in a picture.

2007-08-23 Thread Bart Joosen
Hi, Maybe this is more a programming questions than a specific R-project question, but maybe there is someone who can point me in the right direction. I have a picture of cirkels which I took with a digital camera. Now I want to use the diameter of the cirkels on the picture for analysis in R.

Re: [R] state map question

2007-08-23 Thread Henrique Dallazuanna
map('state', col=terrain.colors(50), fill=T) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 23/08/07, Smith, Phil (CDC/CCID/NCIRD) [EMAIL PROTECTED] wrote: Hi R-Help: I want to produce a map of the US with different colors for selected states. I installed the

Re: [R] R old versions archive anywhere?

2007-08-23 Thread Dirk Eddelbuettel
On 23 August 2007 at 19:37, (Ted Harding) wrote: | Does anyone know if (apparently not on CRAN) there is | any archive of older versions of R packages? See $CRAN/src/contrib/Archive/ which has further subdirectories A to Z each of which contain all known versions of all packages

Re: [R] Calculating diameters of cirkels in a picture.

2007-08-23 Thread Paul Smith
On 8/23/07, Bart Joosen [EMAIL PROTECTED] wrote: Maybe this is more a programming questions than a specific R-project question, but maybe there is someone who can point me in the right direction. I have a picture of cirkels which I took with a digital camera. Now I want to use the diameter

[R] Calculating diameters of cirkels in a picture.

2007-08-23 Thread Bart Joosen
Hi, Maybe this is more a programming questions than a specific R-project question, but maybe there is someone who can point me in the right direction. I have a picture of cirkels which I took with a digital camera. Now I want to use the diameter of the cirkels on the picture for analysis in R.

[R] Expedite scalar f(x) evaluation over vectors

2007-08-23 Thread Scott Stark
Dear R community, I am trying to code a fairly complex equation for optim(). My current approach is too slow for optim(). I have a function that takes a double integral (hopefully correctly) across two terms, e.g., doubleint - function(c1,c2) {integrate(function(y) { sapply(y, function(y)

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread Deepayan Sarkar
On 8/23/07, Duncan Murdoch [EMAIL PROTECTED] wrote: On 8/23/2007 11:28 AM, Prof Brian Ripley wrote: On Thu, 23 Aug 2007, John Kane wrote: The FAQ Section 7 is a very useful place for new users to find out any number of R idiosycracies. However there is no numbering on the FAQ Table of

Re: [R] FAQ 7.x when 7 does not exist. Useability question

2007-08-23 Thread John Kane
--- Prof Brian Ripley [EMAIL PROTECTED] wrote: On Thu, 23 Aug 2007, John Kane wrote: The FAQ Section 7 is a very useful place for new users to find out any number of R idiosycracies. However there is no numbering on the FAQ Table of Content or on the Sections Tables of Contents.

Re: [R] Calculating diameters of cirkels in a picture.

2007-08-23 Thread Julian Burgos
Hi Bart, If you only have 36 circles, the fastest way would be to use some image processing software and measure the circles by hand. One option is to use ImageJ, which you can download here http://rsb.info.nih.gov/ij/ Julian Bart Joosen wrote: Hi, Maybe this is more a programming

Re: [R] Expedite scalar f(x) evaluation over vectors

2007-08-23 Thread Charles C. Berry
On Thu, 23 Aug 2007, Scott Stark wrote: Dear R community, I am trying to code a fairly complex equation for optim(). My current approach is too slow for optim(). I have a function that takes a double integral (hopefully correctly) across two terms, e.g., doubleint - function(c1,c2)

[R] in cor.test, difference between exact=FALSE and exact=NULL

2007-08-23 Thread Andrew Yee
Pardon my ignorance, but is there a difference in cor.test between exact=FALSE and exact=NULL when method=spearman? Take for example: x-c(1,2,2,3,4,5) y-c(1,2,2,10,11,12) cor.test(x,y, method=spearman, exact=NULL) This gives an error message, Warning message: Cannot compute exact p-values with

[R] Clarification: Expedite scalar f(x) evaluation over vectors

2007-08-23 Thread Scott Stark
Please note clarifications in below. My apologies for any confusion. Thanks again, Scott -- Forwarded message -- From: Scott Stark [EMAIL PROTECTED] Date: Aug 23, 2007 1:03 PM Subject: Expedite scalar f(x) evaluation over vectors To: [EMAIL PROTECTED] Dear R community, I am

Re: [R] Calculating diameters of cirkels in a picture.

2007-08-23 Thread Moshe Olshansky
Hi Bart, I have never used image processing software in R (I was doing this with Matlab), but here is what I would have done algorithmically: 1) convert the picture to gray-scale 2) find a threshold value which separates the circles from the background and convert your image to black and white 3)

Re: [R] Choice of data.frame column by index?

2007-08-23 Thread Moshe Olshansky
This won't work since it produces a matrix (try this). What should work is x[(1:nrow(x)) + nrow(x)*(v-1)] --- Johannes Graumann [EMAIL PROTECTED] wrote: Thanks! Joh On Thursday 23 August 2007 12:01:50 you wrote: x[cbind(1:nrow(x), the.vector)] Patrick Burns [EMAIL PROTECTED]

Re: [R] Clarification: Expedite scalar f(x) evaluation over vectors

2007-08-23 Thread Daniel Lakeland
On Thu, Aug 23, 2007 at 03:44:36PM -0700, Scott Stark wrote: Please note clarifications in below. My apologies for any confusion. Thanks again, Scott -- Forwarded message -- From: Scott Stark [EMAIL PROTECTED] Date: Aug 23, 2007 1:03 PM Subject: Expedite scalar f(x)

Re: [R] Choice of data.frame column by index?

2007-08-23 Thread Moshe Olshansky
Correct, I didn't notice that the coma was inside the cbind(). Sorry... --- Rolf Turner [EMAIL PROTECTED] wrote: On 24/08/2007, at 12:51 PM, Moshe Olshansky wrote: This won't work since it produces a matrix (try this). On the contrary, Patrick's solution is correct. I tried

Re: [R] Choice of data.frame column by index?

2007-08-23 Thread Rolf Turner
On 24/08/2007, at 12:51 PM, Moshe Olshansky wrote: This won't work since it produces a matrix (try this). On the contrary, Patrick's solution is correct. I tried it. It works just fine. cheers, Rolf Turner What should work

Re: [R] Calculating diameters of cirkels in a picture.

2007-08-23 Thread Moshe Olshansky
Hi Bart, One more comment: You do not really need the morphological closing to close the holes inside the circles. Another possibility is to reverse the black-and-withe picture, i.e. make the holes and background be 1 and the circles 0, label the connected components and then only the component

[R] [Stat] Question

2007-08-23 Thread adschai
Hi, I am getting stuck with kalman filter a little bit. If anyone could provide some help, I would really appreciated. Basically, I have some of the observations that are irregularly spaced on the time axis. Says, each data of mine is supposed to be of 1 millisec interval. However, in some

[R] uneven list to matrix

2007-08-23 Thread Christopher Marcum
Hello, I am sure I am not the only person with this problem. I have a list with n elements, each consisting of a single column matrix with different row lengths. Each row has a name ranging from A to E. Here is an example: alph[[1]] A 1 B 2 C 3 D 4 alph[[2]] A 1 C 3 D 4 alph[[3]] A 1 D 4 E 5

Re: [R] uneven list to matrix

2007-08-23 Thread Gabor Grothendieck
Here are two solutions. The first repeatedly uses merge and the second creates a zoo object from each alph component whose time index consists of the row labels and uses zoo's multiway merge to merge them. # test data m - matrix(1:5, 5, dimnames = list(LETTERS[1:5], NULL)) alph -

Re: [R] uneven list to matrix

2007-08-23 Thread Christopher Marcum
Hi Gabor, Thank you. The native solution works just fine, though there is an interesting side effect, namely, that with very large lists the rows of the output become scrambled though the corresponding columns are correctly sorted. The zoo package solution does not work on large lists: there is

[R] chi-square statistics

2007-08-23 Thread karen yu
I'm wondering if R has functions to return pvalues with given x-squares and df. I googled for it but couldn't seem to find one. Appreciate any helps here. An example: df=4, x- c(33.69, 32.96, 30.90) which are the statistic for chi-square, I'd like to get the corresponding pvalues for each values

Re: [R] Error building R 2-5.2.1 on Sun Solaris 8

2007-08-23 Thread Prof Brian Ripley
What is 'R 2-5.2.1'? AFAIK there is no such version. I can tell you the most likely issue: is your Perl is pre 5.6.1 (very old indeed)? The current R-patched (2.5.1 patched) requires Perl 5.6.1, and we do suggest that you install that rather than 2.5.1. (Interestingly, all versions of R

Re: [R] uneven list to matrix

2007-08-23 Thread Gabor Grothendieck
On 8/24/07, Christopher Marcum [EMAIL PROTECTED] wrote: Hi Gabor, Thank you. The native solution works just fine, though there is an interesting side effect, namely, that with very large lists the rows of the output become scrambled though the corresponding columns are correctly sorted. The

Re: [R] chi-square statistics

2007-08-23 Thread Robert A LaBudde
At 12:41 AM 8/24/2007, Karen wrote: I'm wondering if R has functions to return pvalues with given x-squares and df. I googled for it but couldn't seem to find one. Appreciate any helps here. An example: df=4, x- c(33.69, 32.96, 30.90) which are the statistic for chi-square, I'd like to get the

Re: [R] uneven list to matrix

2007-08-23 Thread Christopher Marcum
Hi Gabor, My apologies. Both solutions work just fine on large lists (n=1000, n[[i]]=500). A memory problem on my machine caused the error and fail-to-sort. Thank you! PS - The zoo method is slightly faster. Best, Chris Gabor Grothendieck wrote: On 8/24/07, Christopher Marcum [EMAIL

Re: [R] uneven list to matrix

2007-08-23 Thread Gabor Grothendieck
OK. One other thought. The R merge command has a sort= argument that you can try out. See ?merge On 8/24/07, Christopher Marcum [EMAIL PROTECTED] wrote: Hi Gabor, My apologies. Both solutions work just fine on large lists (n=1000, n[[i]]=500). A memory problem on my machine caused the