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

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

Re: [R] R-package install

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

[R] Color of box frame in Legend (Was: Matrix barplot)

2008-07-26 Thread Andreas Tille
On Fri, 25 Jul 2008, Nutter, Benjamin wrote: data - data.frame(Year=c(2000,2001,2002), After the great help here I have a final problem (bug in R??) with the background color. I would like to put my final drawing on a dark background and thus I would like to use brigt colors for axes etc.

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

2008-07-26 Thread Prof Brian Ripley
There is no 'R 2.7' (see the posting guide). Have you followed the advice in the posting guide of using the latest (R-patched) version of R? I believe that this has been fixed since 2.7.0. Please note Mac-specific issues as such on the subject line, and preferably ask them on the R-sig-mac

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

2008-07-26 Thread Martin Maechler
jh == jim holtman [EMAIL PROTECTED] on Fri, 25 Jul 2008 12:34:49 -0400 writes: jh == jim holtman [EMAIL PROTECTED] on Fri, 25 Jul 2008 12:34:49 -0400 writes: jh Does this do what you want: x - matrix(1:25,5) x jh [,1] [,2] [,3] [,4] [,5] jh [1,]16

Re: [R] parametric bootstrap

2008-07-26 Thread Prof Brian Ripley
On Sat, 26 Jul 2008, laila khalfan wrote: Hi I am trying to find a parametric bootstrap confidence interval and when I used the boot function I get zero bias and zero st.error? What could be my mistake? The way you simulated the 'parametric bootstrap'. Thank you and take care. Laila

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

2008-07-26 Thread David Hajage
Oh... No, I don't need to read the documentation again. I just need to wake up... 2008/7/25 Frank E Harrell Jr [EMAIL PROTECTED] David Hajage wrote: 2008/7/25 Frank E Harrell Jr [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] David Hajage wrote: Hello R users, I have

[R] Fw: how i can install Rgraphviz in R2.7.1

2008-07-26 Thread haani hanni
--- On Thu, 17/7/08, haani hanni [EMAIL PROTECTED] wrote: From: haani hanni [EMAIL PROTECTED] Subject: Fw: how i can install Rgraphviz in R2.7.1 To: R-help@r-project.org Date: Thursday, 17 July, 2008, 10:41 AM --- On Tue, 15/7/08, haani hanni [EMAIL PROTECTED] wrote: From: haani hanni [EMAIL

[R] gam() of package mgcv and anova()

2008-07-26 Thread Kunio takezawa
R-users E-mail: r-help@r-project.org Hi! R-users. A simple object as below was created to see how gam() of package mgcv and anova() work. function() { library(mgcv) set.seed(12) nd - 100 xx1 - runif(nd, min=1, max=10) xx1 - sort(xx1) yy - sin(xx1)+rnorm(nd, mean=5, sd=5)

Re: [R] melting a list: basic question

2008-07-26 Thread baptiste auguie
On 26 Jul 2008, at 02:52, hadley wickham wrote: On Fri, Jul 25, 2008 at 8:50 PM, hadley wickham [EMAIL PROTECTED] wrote: On Fri, Jul 25, 2008 at 9:49 AM, baptiste auguie [EMAIL PROTECTED] wrote: Dear list, I'm trying to use the reshape package to perform a merging operation on a list

[R] Help to Text Windoes in Menu with TCL-TK

2008-07-26 Thread ermimi
Hello Friends!! I need a little help in a Text Windows in my Menu in TCL-TK. I have created a Text Windows with this sentences: require(tcltk) tt - tktoplevel() txt - tktext(tt,bg=white,font=courier) tkgrid(txt) tkinsert(txt,end,Hello, world!)

Re: [R] S4 : setGeneric for classical methods

2008-07-26 Thread cgenolin
Martin Maechler [EMAIL PROTECTED] a écrit : CG == Christophe Genolini [EMAIL PROTECTED] on Tue, 22 Jul 2008 19:04:37 +0200 writes: CG Prof Brian Ripley [EMAIL PROTECTED] a écrit : On Tue, 22 Jul 2008, [EMAIL PROTECTED] wrote: Hi the list (well, half of the list, only

Re: [R] Fw: how i can install Rgraphviz in R2.7.1

2008-07-26 Thread Duncan Murdoch
On 26/07/2008 4:44 AM, haani hanni wrote: --- On Thu, 17/7/08, haani hanni [EMAIL PROTECTED] wrote: From: haani hanni [EMAIL PROTECTED] Subject: Fw: how i can install Rgraphviz in R2.7.1 To: R-help@r-project.org Date: Thursday, 17 July, 2008, 10:41 AM --- On Tue, 15/7/08, haani hanni [EMAIL

[R] S-PLUS code in R

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

[R] response surface analysis

2008-07-26 Thread Jinsong Zhao
Hi, Is there a package that could do response surface analysis equivalent to SAS RSREG procedure? Thanks! Regards, Jinsong __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] S-PLUS code in R

2008-07-26 Thread Duncan Murdoch
On 26/07/2008 7:40 AM, Fotis Papailias wrote: Dear R-users, I have sent another mail some hour ago about a matlab Code I was trying to translate in R. Actually I have found a simpler code originally written in S-PLUS for the same function. Author's page -

Re: [R] S-PLUS code in R

2008-07-26 Thread Fotis Papailias
Hi, thanks for your message. You mean to rewrite the function like that: lw - function(d, x, im) { peri1 - per(x) len - length(x) m - len/im peri - peri1[2:(m+1)] z - c(1:m) freq - ((2*pi)/len) * z result - log(sum(freq^(2*d-1)*peri))-(2*d)/m * sum(log(freq)) } and

Re: [R] Simple vector question.

2008-07-26 Thread jim holtman
you would basically change the statement as follows: aggregate(x$Quantity, list(DayOfYear=x$DayOfYear, Category=x$Category), FUN=sum) On Sat, Jul 26, 2008 at 2:30 AM, [EMAIL PROTECTED] wrote: Thank you this is exactly what I wanted. I was unaware of the 'aggregate' function. Now what if I

Re: [R] S-PLUS code in R

2008-07-26 Thread Fotis Papailias
I made some experiments and I conclude that if I change the interval (e.g. say c(-100,100)!!!) then the minimum value changes in respect to the simulated data. So, probably the problem lies in the optimal values of the interval? On Sat, Jul 26, 2008 at 1:00 PM, Fotis Papailias [EMAIL

[R] competing risk model with time dependent covariates

2008-07-26 Thread phguardiol
Dear R users, is there a way, I mean a package, to perform a competing risk model which can handle time dependent covariates ? my main covariate (additional treatment to patients) appears not to follow the proportional hazards assumption, its effect being observed after one year of

Re: [R] S4 : setGeneric for classical methods

2008-07-26 Thread Martin Maechler
CG == Christophe Genolini [EMAIL PROTECTED] on Sat, 26 Jul 2008 12:12:12 +0200 writes: CG Martin Maechler [EMAIL PROTECTED] a écrit : CG == Christophe Genolini [EMAIL PROTECTED] on Tue, 22 Jul 2008 19:04:37 +0200 writes: CG Prof Brian Ripley

Re: [R] S-PLUS code in R

2008-07-26 Thread Fotis Papailias
Dear R-Users, the problem I was facing it's solved. Actually, the code was ok from the first time. You define it as: lw - function(h, x, im) { peri1 - per(x) len - length(x) m - len/im peri - peri1[2:(m+1)] z - c(1:m) freq - ((2*pi)/len) * z result -

Re: [R] R-package install

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

Re: [R] Fw: how i can install Rgraphviz in R2.7.1

2008-07-26 Thread Martin Morgan
Duncan Murdoch [EMAIL PROTECTED] writes: On 26/07/2008 4:44 AM, haani hanni wrote: --- On Thu, 17/7/08, haani hanni [EMAIL PROTECTED] wrote: From: haani hanni [EMAIL PROTECTED] Subject: Fw: how i can install Rgraphviz in R2.7.1 To: R-help@r-project.org Date: Thursday, 17 July, 2008, 10:41

Re: [R] response surface analysis

2008-07-26 Thread milton ruser
Hi Jimsong, If I understood your point, give a look at adehabitat and grasp packages. Almost for adehabitat there are a demo for you see its functionality. Cheers, miltinho astronauta brazil On 7/26/08, Jinsong Zhao [EMAIL PROTECTED] wrote: Hi, Is there a package that could do response

[R] Remove non-numerical columns from data frame

2008-07-26 Thread Markus Mühlbacher
Hello, My question sounds simple, but as I am desperatly searchin for a solution I am asking you all. :) I try to filter out all non-numeric columns of a data frame using a for loop to go through all columns. My if clause looks like this: for(j in 1:length(data)) {

Re: [R] Remove non-numerical columns from data frame

2008-07-26 Thread Henrique Dallazuanna
Try this: x - data.frame(A=c(10,20), B = c(a, b), C = c(20,30)) x[sapply(x, is.numeric)] On Sat, Jul 26, 2008 at 11:19 AM, Markus Mühlbacher [EMAIL PROTECTED] wrote: Hello, My question sounds simple, but as I am desperatly searchin for a solution I am asking you all. :) I try to filter out

[R] issues with gap.plot function

2008-07-26 Thread Zheng Lu
Dear all: I have the following codes: Xdata-c(2,3,8,9,10) Ydata-1:5 gap.plot(Xdata, Ydata,gap=c(5,6),gap.axis=x,type=o) However, the type='o' seems only work on the first part of gap plot, the second half of the plot always just points, you can not add lines on that part, any help will

[R] parametric bootstrap

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

[R] .Rprofile in RFrameworks?

2008-07-26 Thread Fredrik Lundgren
Dear R'rrs I'm on Mac OS X Leopard 10.5.4 with R 2.7.1 Where exactly should I place a .Rprofile to get site changes (there are lots of etc in frameworks and I can't get it right)? Sincerely Fredrik Fredrik Lundgren [EMAIL PROTECTED] Obs! Ny adress och mail

[R] Beginning lm

2008-07-26 Thread rkevinburton
I have ussed lm to generate a basic line correlation: fit = lm(hours.of.sleep ~ ToSleep) Note: From Bayesian Computation with R, Jim Albert, p. 7 I understand the simple y = mx + b line that this fits the data to. Now apparently I don't understand formulas. The documentation indicates that

[R] Can't get the correct order from melt.data.frame of reshape library.

2008-07-26 Thread Daren Tan
Simple illustration, df3 - data.frame(id=c(3,2,1,4), age=c(40,50,60,50), dose1=c(1,2,1,2), dose2=c(2,1,2,1), dose4=c(3,3,3,3)) df3 id age dose1 dose2 dose41 3 40 1 2 32 2 50 2 1 33 1 60 1 2 34 4 50 2 1 3 melt.data.frame(df3,

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

2008-07-26 Thread Matthew Keller
Hi Joseph, For what it is worth (which might not be that much!), I have written down step by step instructions on my website for getting 64 bit R working under Leopard - it should be much different with Tiger: http://www.matthewckeller.com/html/64_bit_r_on_mac.html. I think it'll work but there

Re: [R] Remove non-numerical columns from data frame

2008-07-26 Thread Peter Dalgaard
Henrique Dallazuanna wrote: Try this: x - data.frame(A=c(10,20), B = c(a, b), C = c(20,30)) x[sapply(x, is.numeric)] Yes, and read ?Extract to clear up the confusion between data$vol and data[257] and data[[257]] (Section on Recursive (list-like) objects:). Also, ?Extract.data.frame.

Re: [R] Beginning lm

2008-07-26 Thread Mark Difford
Hi Kevin, Can anyone give me a short tutorial on the formula syntax? ... I am sorry but I could not glean this information from the help page on lm. You can give yourself a very good tutorial by reading ?formula and Chapter 12 of

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

2008-07-26 Thread Joseph Retzer
Thanks for the information, and correcting my poorly written post. Applying the patch solved the problem. Joe Retzer --- On Sat, 7/26/08, Prof Brian Ripley [EMAIL PROTECTED] wrote: From: Prof Brian Ripley [EMAIL PROTECTED] Subject: Re: [R] Thin frame line around R pdf output in LaTeX To: Joseph

Re: [R] Beginning lm

2008-07-26 Thread Marc Schwartz
on 07/26/2008 10:37 AM [EMAIL PROTECTED] wrote: I have ussed lm to generate a basic line correlation: fit = lm(hours.of.sleep ~ ToSleep) Note: From Bayesian Computation with R, Jim Albert, p. 7 I understand the simple y = mx + b line that this fits the data to. Now apparently I don't

[R] question about cmprsk library

2008-07-26 Thread phguardiol
Dear R users, is there a way to perform a competing risk model which can handle time dependent covariates ? my main covariate (additional treatment to patients) violates the proportional hazards assumption, its effect being observed after one year of treatment but not before (this

Re: [R] Remove non-numerical columns from data frame

2008-07-26 Thread Henrik Bengtsson
On Sat, Jul 26, 2008 at 9:35 AM, Peter Dalgaard [EMAIL PROTECTED] wrote: Henrique Dallazuanna wrote: Try this: x - data.frame(A=c(10,20), B = c(a, b), C = c(20,30)) x[sapply(x, is.numeric)] Yes, and read ?Extract to clear up the confusion between data$vol and data[257] and data[[257]]

[R] Add a Vector to a Matrix

2008-07-26 Thread ascentnet
I know there is a very simple answer to this question, but it eludes me. I need to insert a vector into a matrix. So if I have a 2 column matrix with 5 rows, I need to insert in an additional vector so there is now 6 rows without overwriting any of the data in the matrix already. thanks, Ben.

Re: [R] Add a Vector to a Matrix

2008-07-26 Thread Marc Schwartz
on 07/26/2008 10:16 AM ascentnet wrote: I know there is a very simple answer to this question, but it eludes me. I need to insert a vector into a matrix. So if I have a 2 column matrix with 5 rows, I need to insert in an additional vector so there is now 6 rows without overwriting any of the

Re: [R] issues with gap.plot function

2008-07-26 Thread Ben Bolker
Zheng Lu zlu at umich.edu writes: Dear all: I have the following codes: Xdata-c(2,3,8,9,10) Ydata-1:5 gap.plot(Xdata, Ydata,gap=c(5,6),gap.axis=x,type=o) However, the type='o' seems only work on the first part of gap plot, the second half of the plot always just points, you

[R] Sample

2008-07-26 Thread Raphael Saldanha
Hi! I have a data.frame, like this one: data 0-100 100-250 250+ a 9 18 16 b33 25 27 c21 19 17 d25 22 19 e40 39 19 f77 45 29 If I request a sample of 2, I have the following: sample(data, 2) 0-100 250+ a 9 16 b33

Re: [R] Sample

2008-07-26 Thread jim holtman
like this: x 0-100 100-250 250+ a 9 18 16 b33 25 27 c21 19 17 d25 22 19 e40 39 19 f77 45 29 x[sample(nrow(x), 3),] 0-100 100-250 250+ e40 39 19 c21 19 17 a 9 18 16 x[sample(nrow(x), 3),]

Re: [R] Sample

2008-07-26 Thread Ted Harding
On 26-Jul-08 21:12:56, Raphael Saldanha wrote: Hi! I have a data.frame, like this one: data 0-100 100-250 250+ a 9 18 16 b33 25 27 c21 19 17 d25 22 19 e40 39 19 f77 45 29 If I request a sample of 2, I have the

[R] Data length mismatch.

2008-07-26 Thread rkevinburton
I have two vectos (list) that represent a years of data. Each row is represented by the day of year and the quantity that was sold for that day. I would like to form a new vector that is the difference between the two years of data. A sample of A (and similarly B) looks like: A[1:5,]

Re: [R] Sample

2008-07-26 Thread Raphael Saldanha
Thanks everybody! Using the package *sampling *, for another aproach: population 0-100 100-250 250+ Região 1 9 18 16 Região 233 25 27 Região 321 19 17 Região 425 22 19 Região 540 39 19 Região 677 45 29 sample_design -

[R] Spatial Sample

2008-07-26 Thread Raphael Saldanha
Hi! How can I make a spatial sample? Can someone recommend theorical books and materials for this? -- Raphael Saldanha UFJF - Brazil [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Data length mismatch.

2008-07-26 Thread Gabor Grothendieck
Look at merge.zoo library(zoo) dput(A) structure(list(DayOfYear = 1:5, x = c(1429L, 3952L, 3049L, 2844L, 2219L)), .Names = c(DayOfYear, x), class = data.frame, row.names = c(1, 2, 3, 4, 5)) B - A[c(2,4),] Az - zoo(A$x, A$DayOfYear) Bz - zoo(B$x, B$DayOfYear) merge(Az, Bz, fill = 0) Az

Re: [R] Data length mismatch.

2008-07-26 Thread Gabor Grothendieck
For the last statement we may prefer this so it stays a zoo object: m - merge(Az, Bz, fill = 0) m[,1] - m[,2] 12345 14290 30490 2219 On Sat, Jul 26, 2008 at 5:53 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Look at merge.zoo library(zoo) dput(A)

Re: [R] Marking Interval Length

2008-07-26 Thread jim holtman
The original example that you sent was in the long format: brkdn(intervals~country,jymint.df,num.desc=c(mean,median)) Breakdown of intervals by country Level mean median au 0.01 0 br -0.07 1 cn -0.32 2 in

Re: [R] [R-sig-Geo] Spatial Sample

2008-07-26 Thread Paul Hiemstra
Hi, One option is: ?spsample cheers, Paul Raphael Saldanha schreef: Hi! How can I make a spatial sample? Can someone recommend theorical books and materials for this? -- Raphael Saldanha UFJF - Brazil [[alternative HTML version deleted]]

Re: [R] Data length mismatch.

2008-07-26 Thread Gabor Grothendieck
Here is a second solution. This one uses sqldf instead of zoo: library(zoo) sqldf(select A.x - ifnull(B.x, 0) from A left join B using(DayOfYear)) See http://sqldf.googlecode.com On Sat, Jul 26, 2008 at 5:26 PM, [EMAIL PROTECTED] wrote: I have two vectos (list) that represent a years of

Re: [R] Data length mismatch.

2008-07-26 Thread Gabor Grothendieck
Here is a third solution. A[B$DayOfYear, x] - A[B$DayOfYear, x] - B$x Its assumes B's days are a subset of A's but if that's not the case then you would need to intersect them first: ?intersect On Sat, Jul 26, 2008 at 5:26 PM, [EMAIL PROTECTED] wrote: I have two vectos (list) that represent a

Re: [R] Data length mismatch.

2008-07-26 Thread Gabor Grothendieck
Sorry, the last one should be: ix - match(B$DayOfYear, A$DayOfYear) A[ix, x] - A[ix, x] - B$x Again we are assuming B's days are a subset of A's. On Sat, Jul 26, 2008 at 6:08 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Here is a third solution. A[B$DayOfYear, x] - A[B$DayOfYear, x] - B$x

[R] Coarsening the Resolution of a Dataset

2008-07-26 Thread Steve Murray
Dear all, I have gridded data at 5' (minutes) resolution, which I intend to coarsen to 0.5 degrees. How would I go about doing this in R? I've had a search online and haven't found anything obvious, so any help would be gratefully received. I'm assuming that there will be several 'coarsening'

Re: [R] Coarsening the Resolution of a Dataset

2008-07-26 Thread jim holtman
Here is one approach for using the average of each interval: # generate some test data; assume 1.0 is one degree min.5 - 5 / 60 # portion of degree for 5 minutes n - 100 # number of data points myData - cbind(interval=seq(0, by=min.5, length=n), value=runif(n)) # create breaks every 0.5

Re: [R] Dividing by 0

2008-07-26 Thread John Maindonald
I suspect you should be smoothing the series in a manner that replaces zeros by some usually small larger number before you start. Without more details on what you are trying to do, it is impossible to know what is sensible. You are proposing to leave all smoothing (rolling?) till later; why

Re: [R] Analyzing Intervals between Data

2008-07-26 Thread jim holtman
You need to provide a definition of what the spell length is since I am not an economist. Given that you have a list of prices, how do you determine the spell length and then what do you do with the data in each interval? This is what you would have to clarify, at from my point of view, so that

Re: [R] Data length mismatch.

2008-07-26 Thread Don MacQueen
I think the merge() function should be adequate for this task. Here is an example. A - data.frame(day=1:5, x=runif(5)) B - data.frame(day=3:7, x=runif(5)) A day x 1 1 0.9764534 2 2 0.9693998 3 3 0.1324933 4 4 0.8311153 5 5 0.3264465 B - data.frame(day=3:8,

Re: [R] Analyzing Intervals between Data

2008-07-26 Thread Jia Ying Mei
Hi Jim, I did define it, although I guess I wasn't clear. The spell length is essentially the interval of time between price changes. So in the data, say a price starts at 3, and then 150 days later, the price changes to 4. The spell length is 150, the interval of time between the price

[R] GLS no terms component error

2008-07-26 Thread mm745
Hi, I want to test for independence in my GLS model fitp2, but when I try to use the dwtest function in the lmtest library, I get the error message Error in terms.default(formula) : no terms component. The model and data set are below. Any suggestions would be really helpful! Thanks a lot in

Re: [R] GLS no terms component error

2008-07-26 Thread Bill.Venables
The help file for dwtest says formula: a symbolic description for the model to be tested (or a fitted lm object). It is not clear from your message, but it would seem that you used fitp2 as the argument to dwtest. (In any case, this gives the error message you quote?) But fitp2 is neither a

Re: [R] Analyzing Intervals between Data

2008-07-26 Thread jim holtman
I think I understand it now. So if there is any change (even very small), then that starts a new interval. On Sat, Jul 26, 2008 at 9:38 PM, Jia Ying Mei [EMAIL PROTECTED] wrote: Hi Jim, I did define it, although I guess I wasn't clear. The spell length is essentially the interval of time

[R] Lattice wireframe: How to avoid drawing lines around polygons when using shade=TRUE

2008-07-26 Thread Oliver M. Haynold
I am using wireframe from the lattice package, with the shade option set to TRUE. When I output to PDF or Postscript, a line gets drawn around each polygon of my surface which causes ugly Moiré effects and doesn't make sense in my application (think the plot of Maunga Whau--gridlines don't

Re: [R] Analyzing Intervals between Data

2008-07-26 Thread jim holtman
If I look at the data for one of the countries (Brazil), I see NAs in the ranges. How is the following condition handled to determine the spell length? Are values propogated forward 426 1/12/00 Brazil (RS) 7.5 2000-01-12 425 3/18/00 Brazil (RS) 7.5 2000-03-18 424 3/31/00 Brazil (RS)