Re: [R] Which is the best hardware?

2005-12-06 Thread Prof Brian Ripley
On Mon, 5 Dec 2005, Kenneth Cabrera wrote: Hi R users: In your opinion and experience, which hardware configuration is the best to run R over LINUX ? With best I mean best performance, and also cheapest. (about U$ 2.000 the whole basic system: mother board+CPUs+RAM+HD) I presume you

[R] Help

2005-12-06 Thread Sumanta Basak
Hi R-Users, I apologize if it is too simple question for all. I have a multivariate dataset having 7 variables as independent and 1 dependent variable. 248 data points are there. I want to do out sample forecast first considering 156 points. So I'll have to start from 157th point and calculate

Re: [R] extracting p-values from lmer()

2005-12-06 Thread Martin Maechler
Renaud == Renaud Lancelot [EMAIL PROTECTED] on Tue, 6 Dec 2005 08:09:35 +0100 writes: Renaud For example: vc - vcov(m1, useScale = FALSE) b - fixef(m1) se - sqrt(diag(vc)) z - b / sqrt(diag(vc)) P - 2 * (1 - pnorm(abs(z))) cbind(b, se, z, P)

[R] how to extract row col names from a matrix

2005-12-06 Thread shanmuha boopathy
Dear all, I like to extract row names column names from the named matrix.. like.. a-matrix(1:6,2) ro-c(aa,bb) co-c(dd,ee,ff) dimnames(a)-list(ro,co) a dd ee ff aa 1 3 5 bb 2 4 6 from the above matrix a I like to extract rownames separately like

[R] Writing a list to a file !

2005-12-06 Thread A Ezhil
Hi All, This may be trivial in R but I have been trying with out any success. I have a list of 100 elements each having a sub list of different length. I would like to write the list to a ASCII file. I tried with write.table(), after converting my list to a matrix. Now it looks like Robert

[R] figure with inset

2005-12-06 Thread Pascal . Niklaus
I am trying to plot a figure within a figure (an inset that shows a closeup of part of the data set). I have searched R-help and other sources but not found a solution. What I would like to do is (1) produce a plot (2) specify a window that will be used for the next plot (in inches or using the

[R] how to draw continent boundry

2005-12-06 Thread Yogesh K. Tiwari
Hi, If I am ploting a world map like plot (lon,lat) then how to draw a continent boundry in that plot. What is the command... Many thanks Regards, Yogesh -- === Yogesh K. Tiwari, Max-Planck Institute for Biogeochemistry, Hans-Knoell Strasse 10,

[R] how to get or store the intermediate v?lues while running a function

2005-12-06 Thread shanmuha boopathy
Dear all, While running a function I´m getting only the final output of the function. Bit if I like to store or recover some values that are intermediate in the function calculations which command I have to use for storing those values. hope u understand. for

Re: [R] figure with inset

2005-12-06 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: I am trying to plot a figure within a figure (an inset that shows a closeup of part of the data set). I have searched R-help and other sources but not found a solution. See the examples on the grid package by Paul Murrel in R News. Uwe Ligges What I would like

[R] about partial correlation

2005-12-06 Thread Vangelis Panagiotaras
Hello everyone My name is Vangelis and I want to ask a question about partial correlation. I have used the command pcor.shrink to evaluate the partial correlations of a data.frame but the problem is that in the output results I cannot see whether these correlations are significant or not. Is

Re: [R] how to extract row col names from a matrix

2005-12-06 Thread Kristel Joossens
You mean somthing like the following? cat(();cat(rownames(a),sep=,);cat()) cat(();cat(colnames(a),sep=,);cat()) Best regrads, Kristel shanmuha boopathy wrote: Dear all, I like to extract row names column names from the named matrix.. like.. a-matrix(1:6,2)

Re: [R] Writing a list to a file !

2005-12-06 Thread Kristel Joossens
as.numeric? E.g. R res [1] 90 50 30 R as.numeric(res) [1] 90 50 30 A Ezhil wrote: Hi All, This may be trivial in R but I have been trying with out any success. I have a list of 100 elements each having a sub list of different length. I would like to write the list to a ASCII file. I

Re: [R] how to draw continent boundry

2005-12-06 Thread Uwe Ligges
Yogesh K. Tiwari wrote: Hi, If I am ploting a world map like plot (lon,lat) then how to draw a continent boundry in that plot. What is the command... See, e.g., the packages maps, mapdata, and mapproj as well as the task view Spatial on CRAN. Uwe Ligges Many thanks

Re: [R] how to extract row col names from a matrix

2005-12-06 Thread vincent
shanmuha boopathy a écrit : a-matrix(1:6,2) ro-c(aa,bb) co-c(dd,ee,ff) dimnames(a)-list(ro,co) (Not sure I fully understand the question), but : rn = rownames(a); cn = colnames(a); __ R-help@stat.math.ethz.ch mailing list

Re: [R] how to get or store the intermediate v?lues while running a function

2005-12-06 Thread vincent
shanmuha boopathy a écrit : a-function(a,b,c,d) { k=a+b l=c+d m=k+l } in this example the function will return only the value of m ...But I like to extract the values of l k also. which command to use for storing or for extracting those intermediate

Re: [R] about partial correlation

2005-12-06 Thread Dimitris Rizopoulos
maybe the function pcor.confint() from package 'GeneNT' could be of help. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015

Re: [R] how to draw continent boundry

2005-12-06 Thread paul sorenson
Have you looked in the maps package? Yogesh K. Tiwari wrote: Hi, If I am ploting a world map like plot (lon,lat) then how to draw a continent boundry in that plot. What is the command... Many thanks Regards, Yogesh __

[R] Help on a matrix task

2005-12-06 Thread Serguei Kaniovski
Hello, Being new to R, I am completely stuck with the following problem. Please help to find a general solution to the following matrix task: Given: N-4 input_mat-matrix(c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,

[R] about partial correlation (again)

2005-12-06 Thread Vangelis Panagiotaras
Hello everyone I tried to install the library GeneNT in order to use the command pcor.confint because I want to construct confidence intervals for partial correlations but among other demanding the specific library needs the library Graph which I don't have it and I cannot find it at this

[R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Martin Maechler
vincent == vincent [EMAIL PROTECTED] on Tue, 06 Dec 2005 11:09:36 +0100 writes: vincent shanmuha boopathy a écrit : a-function(a,b,c,d) { k=a+b l=c+d m=k+l } in this example the function will return only the value of m ...But I like to

Re: [R] Help on a matrix task

2005-12-06 Thread JeeBee
Here is one possible solution: for(cr in seq(1, dim(combin_mat)[2])) { W = which(input_mat[,combin_mat[1,cr]] == 1 input_mat[,combin_mat[2,cr]] == 1) cat(Combination, cr, (, combin_mat[,cr], ) :, W, \n) } JeeBee. --- Full program: N = 4 input_numbers = seq((2^N)-1, 0, -1) #

Re: [R] about partial correlation (again)

2005-12-06 Thread Martin Maechler
Vangelis == Vangelis Panagiotaras [EMAIL PROTECTED] on Tue, 6 Dec 2005 13:39:33 +0200 writes: Vangelis Hello everyone Vangelis I tried to install the library GeneNT in order to use the command Vangelis pcor.confint because I want to construct confidence intervals for

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Adaikalavan Ramasamy
On Tue, 2005-12-06 at 13:43 +0100, Martin Maechler wrote: vincent == vincent [EMAIL PROTECTED] on Tue, 06 Dec 2005 11:09:36 +0100 writes: vincent shanmuha boopathy a écrit : a-function(a,b,c,d) { k=a+b l=c+d m=k+l } in this example

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Philippe Grosjean
Martin Maechler wrote: vincent == vincent [EMAIL PROTECTED] on Tue, 06 Dec 2005 11:09:36 +0100 writes: vincent shanmuha boopathy a écrit : a-function(a,b,c,d) { k=a+b l=c+d m=k+l } in this example the function will return only the

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Adaikalavan Ramasamy
Yes, it drives me mad too when people use = instead of - for assignment and suppress spaces in an naive attempt for saving space. As an example compare o=fn(x=1,y=10,z=1) with o - fn( x=1, y=10, z=1 ) Regards, Adai On Tue, 2005-12-06 at 13:43 +0100, Martin

[R] O-ring statistic in R?

2005-12-06 Thread Rainer M Krug
Hi Thorsten Wiegand used in his paper Wiegand T., and K. A. Moloney 2004. Rings, circles and null-models for point pattern analysis in ecology. Oikos 104: 209-229 a statistic he called O-Ring statistic which is similar to Ripley's K, only that it uses rings instead of circles.

[R] merging with aggregating

2005-12-06 Thread Dubravko Dolic
Dear List, I have two data.frame of the following form: A: n V1 V2 1 12 0 2 10 8 3 3 8 4 8 4 6 7 3 7 12 0 8 1 0 9 18 0 10 1 0 13 2 0 B: n V1 V2 1 0 2 2 0 3 3 1 9 4 12 8 5 2 9 6 2 9 8 2 0 10 4 1 11 7 1 12 0 1 Now I want to merge

[R] Write List to ASCII File !!

2005-12-06 Thread A Ezhil
Hi All, This may be trivial in R but I have been trying with out any success. I have a list of 100 elements each having a sub list of different length. I would like to write the list to a ASCII file. I tried with write.table(), after converting my list to a matrix. Now it looks like Robert

[R] array of lists? is this the best way to do it?

2005-12-06 Thread John McHenry
[Q.] How to create an array of lists, or structures the most elegant way? There have been questions in the past but none too recently...I want to know if the following looks OK to you guys or if there is a better way to create an array of lists: # PREAMBLE ... JUST TO GET THINGS

[R] urgent

2005-12-06 Thread Subhabrata
Hello R Users, I have two sets of values x - c(7, 7 , 8, 9, 15, 17, 18) y - c(7, 8, 9, 15, 17, 19, 20, 20, 25, 23, 22) I am able to create multi histogram using multhist(). But not able to control the 'xlim'. ie the xaxis is showing 7.5, 13, 18, 23 1st on what basis it is calculated 2nd I

[R] reading in data with variable length

2005-12-06 Thread John McHenry
I have very large csv files (up to 1GB each of ASCII text). I'd like to be able to read them directly in to R. The problem I am having is with the variable length of the data in each record. Here's a (simplified) example: $ cat foo.csv Name,Start Month,Data

Re: [R] array of lists? is this the best way to do it?

2005-12-06 Thread Gabor Grothendieck
On 12/6/05, John McHenry [EMAIL PROTECTED] wrote: [Q.] How to create an array of lists, or structures the most elegant way? There have been questions in the past but none too recently...I want to know if the following looks OK to you guys or if there is a better way to create an array of

Re: [R] merging with aggregating

2005-12-06 Thread Marc Schwartz
On Tue, 2005-12-06 at 14:22 +0100, Dubravko Dolic wrote: Dear List, I have two data.frame of the following form: A: n V1 V2 1 12 0 2 10 8 3 3 8 4 8 4 6 7 3 7 12 0 8 1 0 9 18 0 10 1 0 13 2 0 B: n V1 V2 1 0 2 2 0 3 3 1 9 4 12

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread vincent
Martin Maechler a écrit : please, please, these trailing ; are *so* ugly. This is GNU S, not C (or matlab) ! but I'll be happy already if you could drop these ugly empty statements at the end of your lines... May I disagree ? I find missing ; at end of lines *so* ugly. Ugly/not ugly

Re: [R] merging with aggregating

2005-12-06 Thread Dubravko Dolic
Hi all, the moment you hit the 'send' button you know the answer... I approached a solution similar to this one given by Marc. But maybe there is a better one? Even because this operation is done in a for-loop during which R gets new data from a database. So I sum up 16 data.frames eventually.

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Prof Brian Ripley
By the way, does anybody knows if there is a R tidy or some similar project to automatically reformat (and possibly check) R code, beside what Emacs does? See the appropriate section in `Writing R Extensions' (3.1 `Tidying R code'). -- Brian D. Ripley, [EMAIL PROTECTED]

[R] Stack overflow error while creating package

2005-12-06 Thread manohar
Hi all, I am trying to build a package in R (ver 2.1.0, on a PC). I am able to run package.skeleton successfully and populate the different environments. However, when I attempt to invoke the build (R CMD BUILD), i get an error which says something like protect(): Stack Overflow I would

Re: [R] merging with aggregating

2005-12-06 Thread Adaikalavan Ramasamy
m1 - cbind( n=c(1,2,3,4,6,7,8,9,10,13), v1=c(12,10,3,8,7,12,1,18,1,2), v2=c(0,8,8,4,3,0,0,0,0,0) ) m2 - cbind( n=c(1,2,3,4,5,6,8,10,11,12), v1=c(0,0,1,12,2,2,2,4,7,0), v2=c(2,3,9,8,9,9,0,1,1,1) ) m.all - merge(m1, m2, by=n, all=T) n v1.x v2.x v1.y v2.y

Re: [R] urgent

2005-12-06 Thread Adaikalavan Ramasamy
1) R-help mailing list is run entirely by volunteers, so requests such as urgent may sound rude 2) Use an informative subject line please ! 3) Please state which package multhist comes from. 4) Please show your call to multhist. 5) multhist does _histograms_ by aggregating points within

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Xiaofan Li
I consistently use ; at every end of my R code and have found it much more neat than those sentences without an end; for - and =, if I were the author I would rather take the first representation as a sign of passing-by-reference while the latter by value. Xiaofan Li DAMTP, University of

Re: [R] reading in data with variable length

2005-12-06 Thread Liaw, Andy
Use file() connection in conjunction with readLines() and strsplit() should do it. I would try to count the number of lines in the file first, and create a list with that many components, then fill it in. I believe the array of cells in Matlab is sort of equivalent to a list in R, but that's

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread ronggui
=== 2005-12-06 22:16:17 您在来信中写道:=== Martin Maechler a �crit : please, please, these trailing ; are *so* ugly. This is GNU S, not C (or matlab) ! but I'll be happy already if you could drop these ugly empty statements at the end of your lines... May I disagree ? I find missing ;

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Jan T. Kim
On Tue, Dec 06, 2005 at 03:16:17PM +0100, [EMAIL PROTECTED] wrote: Martin Maechler a ?crit : please, please, these trailing ; are *so* ugly. This is GNU S, not C (or matlab) ! but I'll be happy already if you could drop these ugly empty statements at the end of your lines...

Re: [R] reading in data with variable length

2005-12-06 Thread John McHenry
I should have mentioned that I already tried the readLines() approach: ta-readLines(foo.csv) ptm-proc.time() f-character(length(ta)) for (k in 2:length(ta)) { f[k-1]-(strsplit(ta[k],,)[[1]])[3] }# - PARSING EACH LINE AT THIS LEVEL IS WHERE THE REAL INEFFICIENCY IS (proc.time()-ptm)[3] [1]

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread P Ehlers
[EMAIL PROTECTED] wrote: Martin Maechler a écrit : please, please, these trailing ; are *so* ugly. This is GNU S, not C (or matlab) ! but I'll be happy already if you could drop these ugly empty statements at the end of your lines... May I disagree ? I find missing ; at end of

Re: [R] urgent

2005-12-06 Thread P Ehlers
I don't have an answer to your query, but I do have three suggestions: 1. Use a sensible subject line. This may be urgent to you, but I doubt that it is to anyone else. 2. Do indicate what package contains multhist(). I have no idea (nor do I know what a 'multi histogram' is). 3. Don't send

Re: [R] figure with inset

2005-12-06 Thread Berton Gunter
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Uwe Ligges Sent: Tuesday, December 06, 2005 1:54 AM To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] figure with inset [EMAIL PROTECTED] wrote: I am trying to plot a figure

[R] R formatting

2005-12-06 Thread Barry Rowlingson
While mucking about with semicolons and line endings I wrote this little piece of mildly obfuscated R code: f1=function(n){ x = 1 --- n return(x) } [best viewed with a proportionally-spaced font] f1(1) does indeed return 1/1. Baz

Re: [R] merging with aggregating

2005-12-06 Thread Marc Schwartz (via MN)
On Tue, 2005-12-06 at 15:19 +0100, Dubravko Dolic wrote: Hi all, the moment you hit the 'send' button you know the answer... I approached a solution similar to this one given by Marc. But maybe there is a better one? Even because this operation is done in a for-loop during which R gets

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Patrick Burns
I don't put in extraneous ';' because I maybe get a blister on my little finger. I suspect that those who find the semi-colons ugly in R do not find them ugly in C. I think the reason there would be a visceral reaction in R but not in C is that there is a danger when using them in R that they

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread McGehee, Robert
Jan T. Kim wrote: There is a draft R Coding Convention available at http://www.maths.lth.se/help/R/RCC/ which may be useful for finding a style that is good because it is widely used and therefore familiar to a large number of readers.-- However, as the author Henrik Bengtsson

Re: [R] Stack overflow error while creating package

2005-12-06 Thread Martin Maechler
manohar == manohar [EMAIL PROTECTED] on Tue, 6 Dec 2005 06:39:27 -0800 (PST) writes: manohar Hi all, manohar I am trying to build a package in R (ver 2.1.0, on a manohar PC). which I interpret that you are running Windows, right? manohar I am able to run package.skeleton

Re: [R] plot and factors

2005-12-06 Thread tom wright
Your first question seems relatively simple: data.fall-subset(data,semester=='fall') data.spring-subset(data,semester=='spring') data.summer-subset(data,semester=='summer') plot(x=year,y=value1,data=data.fall) lines(x=year,y=value1,data=data.spring) lines(x=year,y=value1,data=data.summer) As

[R] strange behavior of loess() predict()

2005-12-06 Thread Leo Gürtler
Dear altogether, I tried local regression with the following data. These data are a part of a bigger dataset for which loess is no problem. However, the plot shows extreme values and by looking into the fits, it reveals very extreme values (up to 2 !) although the original data are

[R] R newbie...

2005-12-06 Thread David Hajage
Hello, I'm a new user... I have a function : calculate - function(x,y) { z - x + y } I would like to use the result (z) with another function : recalculate - function(...) { a - z^2 } But R says that z does not exist... How can I use z in an another function ? Thank you

Re: [R] R formatting

2005-12-06 Thread Peter Dalgaard
Barry Rowlingson [EMAIL PROTECTED] writes: While mucking about with semicolons and line endings I wrote this little piece of mildly obfuscated R code: f1=function(n){ x = 1 --- n return(x) } [best viewed with a proportionally-spaced font] f1(1) does

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Martin Maechler
P == P Ehlers [EMAIL PROTECTED] on Tue, 06 Dec 2005 08:35:07 -0700 writes: P [EMAIL PROTECTED] wrote: Martin Maechler a écrit : please, please, these trailing ; are *so* ugly. This is GNU S, not C (or matlab) ! but I'll be happy already if you

Re: [R] Stack overflow error while creating package

2005-12-06 Thread Prof Brian Ripley
I don't think this is C stack overflow. His R is so old the message means `protection stack overflow'. The first action (as described in the posting guide) is indeed to update R, though. On Tue, 6 Dec 2005, Martin Maechler wrote: manohar == manohar [EMAIL PROTECTED] on Tue, 6 Dec 2005

[R] xyplot question

2005-12-06 Thread Christoph Scherber
Dear R users, I have a question regarding the use of xyplot in the lattice() package. I have two factors (each with two levels), and I´d like to change the order of the panels in a 2x2 panel layout from the default alphabetic order that R uses based on the names of the factor levels. My

Re: [R] R newbie...

2005-12-06 Thread Sarah Goslee
First of all, you might try reading the manual. Second, you might try something like this: calculate - function(x,y) { z - x + yz } recalculate(z) { a - z^2 a } z - calculate(x, y) recalculate(z) You need to return some value from your functions, and you need to assign that

Re: [R] R newbie...

2005-12-06 Thread David Hajage
Thank you for your answer. And what if my first function gives 2 results : calculate - function(x,y) { a - x + y b - x - y } How can I use both a and b in a new function ? 2005/12/6, Sarah Goslee [EMAIL PROTECTED]: First of all, you might try reading the manual. Second, you

Re: [R] R newbie...

2005-12-06 Thread Kristel Joossens
Her you just make the functions. R calculate - function(x,y){z - x + y} R recalculate - function(z){a - z^2} You should run the functions, by take z as output for the first function ans z as input for the next function: R calculate - function(x,y){z - x + y} R recalculate - function(z){a - z^2}

Re: [R] strange behavior of loess() predict()

2005-12-06 Thread Gavin Simpson
On Tue, 2005-12-06 at 18:09 +0100, Leo Gürtler wrote: Dear altogether, snip # here is the difference!! predict(mod, data.frame(x=X), se=TRUE) predict(mod, x=X, se=TRUE) --- end of snip --- I assume this has some reason but I do not understand this reason. Merci, Not sure if this is

Re: [R] reading in data with variable length

2005-12-06 Thread Gabor Grothendieck
Could you time these and see how each of these do: # 1 ta.split - strsplit(ta, split = ,) ta.num - lapply(ta.split, function(x) as.numeric(x[-(1:2)])) # 2 ta0 - sub(^[^,]*,[^.]*,, , ta) ta.num - lapply(ta0, scan, sep = ,) # 3 - loop version of #1 n - length(ta) ta.split - strsplit(ta, split =

Re: [R] R newbie...

2005-12-06 Thread Sarah Goslee
calculate - function(x,y) { a - x + yb - x - y list(a=a, b=b) } myresult - calculate(x, y) myresult$a myresult$b Please at least read the Introduction to R at http://www.r-project.org/ It covers all of this very basic material. Sarah -- Sarah Goslee http://www.stringpage.com

Re: [R] R newbie...

2005-12-06 Thread Uwe Ligges
David Hajage wrote: Hello, I'm a new user... I have a function : calculate - function(x,y) { z - x + y # insert: z } I would like to use the result (z) with another function : recalculate - function(...) { a - z^2 # insert: a } Type:

Re: [R] R formatting

2005-12-06 Thread Barry Rowlingson
Peter Dalgaard wrote: It doesn't calculate it though... ;-) My previous example is a bit ugly - this one looks nicer: f1=function(n){ -1 x = --- n return(x) } And it returns f(1) as -1/1 and f(-1) as -1/-1 as well. __

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Liaw, Andy
From: Martin Maechler P == P Ehlers [EMAIL PROTECTED] on Tue, 06 Dec 2005 08:35:07 -0700 writes: P [EMAIL PROTECTED] wrote: Martin Maechler a écrit : please, please, these trailing ; are *so* ugly. This is GNU S, not C (or matlab) !

Re: [R] reading in data with variable length

2005-12-06 Thread Ted Harding
On 06-Dec-05 John McHenry wrote: I have very large csv files (up to 1GB each of ASCII text). I'd like to be able to read them directly in to R. The problem I am having is with the variable length of the data in each record. Here's a (simplified) example: $ cat foo.csv

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Xiaofan Li
I consistently use ; at every end of my R code and have found it much more neat than those sentences without an end; for - and =, if I were the author I would rather take the first representation as a sign of passing-by-reference while the latter by value. Xiaofan -Original Message-

Re: [R] reading in data with variable length

2005-12-06 Thread John McHenry
Thanks for the awk scripts, Ted. There are reasons (read political!) why R needs to be able to read the files in directly. But, sure, I agree, why not just awk the durned thing. Just to be clear: the NAs aren't so much unsightly as the storage required in RAM is too much. With 1GB files

[R] how to keep the dropped term at each step when calling step?

2005-12-06 Thread Riyan Cheng
Hi all: I am using the R function step to perform a model selection in backward direction. I'd like to automatically keep the dropped term at each step. So I wrote a filter function for the keep argument. However, the filter function cannot change the value of external variable and so doesn't

Re: [R] R newbie...

2005-12-06 Thread Ted Harding
On 06-Dec-05 David Hajage wrote: Hello, I'm a new user... I have a function : calculate - function(x,y) { z - x + y } I would like to use the result (z) with another function : recalculate - function(...) { a - z^2 } But R says that z does not exist...

[R] Coefficient of association for 2x2 contingency tables

2005-12-06 Thread Alexandre Santos Aguiar
Hi, Found no measure of association or correlation for 2x2 contingency tables in fullrefman.pdf or google. Can someone point to a package that implements such calculations? Thanx. -- Alexandre Santos Aguiar - consultoria para pesquisa em saúde - R Botucatu, 591 cj 81

Re: [R] R newbie...

2005-12-06 Thread paul sorenson
Return something that can hold more than one value, eg: calculate - function(x, y) { list(a=x+y, b=x-y) } David Hajage wrote: Thank you for your answer. And what if my first function gives 2 results : calculate - function(x,y) { a - x + y b - x - y } How can I use

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread vincent
ronggui a écrit : I think it is NOT just for historical reason. see the following example: rm(x) mean(x=1:10) [1] 5.5 x Error: object x not found x is an argument local to mean(), did you expect another answer ? mean(x-1:10) [1] 5.5 x [1] 1 2 3 4 5 6 7 8 9 10 What is the goal

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Ted Harding
On 06-Dec-05 Martin Maechler wrote: [But really, I'm more concerned and quite bit disappointed by the diehard ; lovers] Martin Maechler Well, while not die-hard, I will put in my own little reason for often using ; at the end of lines which don't need them. Basically, this is done to

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread vincent
Patrick Burns a écrit : We get questions on R-help often enough about why code like: if(x 0) y - 4 else y - 4.5e23 doesn't work. If people habitually used semi-colons, those sorts of questions would probably multiply. I wrote end of line in my first message, but in fact I did mean

Re: [R] merging with aggregating

2005-12-06 Thread Pierre Kleiber
Here's a solution that uses aggregate(), as suggested in the subject of this thread. m1 - cbind( n=c(1,2,3,4,6,7,8,9,10,13), v1=c(12,10,3,8,7,12,1,18,1,2), v2=c(0,8,8,4,3,0,0,0,0,0) ) m2 - cbind( n=c(1,2,3,4,5,6,8,10,11,12), v1=c(0,0,1,12,2,2,2,4,7,0),

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Duncan Murdoch
Xiaofan Li wrote: I consistently use ; at every end of my R code and have found it much more neat than those sentences without an end; for - and =, if I were the author I would rather take the first representation as a sign of passing-by-reference while the latter by value. The problem with

[R] Course***R/Splus Fundamentals and Programming Techniques, December 2005

2005-12-06 Thread elvis
Happy Holidays! XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce 2-day R/S-plus Fundamentals and Programming Techniques in : www.xlsolutions-corp.com/Rfund.htm ***Seattle -- January 9th - 10th, 2006 ***San

[R] Course***R/Splus Fundamentals and Programming Techniques, January 2006 Nationwide

2005-12-06 Thread elvis
Happy Holidays! XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce 2-day R/S-plus Fundamentals and Programming Techniques in : www.xlsolutions-corp.com/Rfund.htm ***Seattle -- January 9th - 10th, 2006 ***San

[R] Matrix of dummy variables from a factor

2005-12-06 Thread Charles H. Franklin
What is a simple way to convert a factor into a matrix of dummy variables? fm-lm(y~f) where f is a factor takes care of this in the estimation. I'd like to save the result of expanding f into a matrix for later use. Thanks. Charles -- Charles H. Franklin Professor, Political Science

Re: [R] reading in data with variable length

2005-12-06 Thread John McHenry
Everything has slowed down with #1 and #3 by about 50%. Can't do #2 #4 : ta.num - lapply(ta0, scan, sep = ,) Error in file(file, r) : unable to open connection scan seems to want a file or a connection ... Gabor Grothendieck [EMAIL PROTECTED] wrote: Could you time these and see

Re: [R] Coefficient of association for 2x2 contingency tables

2005-12-06 Thread Søren Højsgaard
The CoCo bundle might contain various measures of association... Søren Fra: [EMAIL PROTECTED] på vegne af Alexandre Santos Aguiar Sendt: ti 06-12-2005 19:48 Til: r-help Emne: [R] Coefficient of association for 2x2 contingency tables Hi, Found no measure of

Re: [R] xyplot question

2005-12-06 Thread Deepayan Sarkar
On 12/6/05, Christoph Scherber [EMAIL PROTECTED] wrote: Dear R users, I have a question regarding the use of xyplot in the lattice() package. I have two factors (each with two levels), and I´d like to change the order of the panels in a 2x2 panel layout from the default alphabetic order that

[R] Constructing a transition matrix

2005-12-06 Thread Chris Stubben
Hi, I would like to construct a transition matrix from a data frame with annual transitions of marked plants. plant-c(1:6) class-c(seed,seed, seed, veg, rep, rep) fate-c(dead, veg,veg,rep, rep, veg) trans-data.frame(plant, class, fate) plant class fate 1 1 seed dead 2 2 seed veg

Re: [R] Writing a list to a file !

2005-12-06 Thread Michael Prager
Here is a function I use to send lists to ASCII files. list2ascii - function(x,file=paste(deparse(substitute(x)),.txt,sep=)) { # MHP July 7, 2004 # R or S function to write an R list to an ASCII file. # This can be used to create files for those who want to use # a spreadsheet or

Re: [R] Coefficient of association for 2x2 contingency tables

2005-12-06 Thread Marc Schwartz (via MN)
On Tue, 2005-12-06 at 16:48 -0200, Alexandre Santos Aguiar wrote: Hi, Found no measure of association or correlation for 2x2 contingency tables in fullrefman.pdf or google. Can someone point to a package that implements such calculations? Thanx. Alexandre, See the assocstats()

Re: [R] figure with inset

2005-12-06 Thread Pascal . Niklaus
Thanks for all your help. For documentation (I'm probably not the last one searching R-help for a solution to this problem), here is what I believe works best for the intended purouse: x-0:10; y-x^4; library(gridBase) X11(width=8,height=8) # produce outer (main) plot plot(x,y,xaxs=i,yaxs=i)

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Liaw, Andy
From: [EMAIL PROTECTED] ronggui a écrit : I think it is NOT just for historical reason. see the following example: rm(x) mean(x=1:10) [1] 5.5 x Error: object x not found x is an argument local to mean(), did you expect another answer ? mean(x-1:10) [1] 5.5 x [1] 1

Re: [R] plot and factors

2005-12-06 Thread Deepayan Sarkar
On 12/2/05, Jason Miller [EMAIL PROTECTED] wrote: Read R-helpers, I'm relatively new to R and trying to jump in feet first. I've been able to learn a lot from on-line and printed documentation, but here's one question to which I can't find an answer. Well, it's a question with a couple

Re: [R] Matrix of dummy variables from a factor

2005-12-06 Thread Liaw, Andy
See ?model.matrix. HTH, Andy From: Charles H. Franklin What is a simple way to convert a factor into a matrix of dummy variables? fm-lm(y~f) where f is a factor takes care of this in the estimation. I'd like to save the result of expanding f into a matrix for later use. Thanks.

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Deepayan Sarkar
On 12/6/05, Ted Harding [EMAIL PROTECTED] wrote: On 06-Dec-05 Martin Maechler wrote: [But really, I'm more concerned and quite bit disappointed by the diehard ; lovers] Martin Maechler Well, while not die-hard, I will put in my own little reason for often using ; at the end of lines

Re: [R] reading in data with variable length

2005-12-06 Thread Liaw, Andy
A slight variation on one of Gabor's idea might work: ## simulate a data file: n - 2e5 minF - 20 maxF - 30 f - file(test.csv, open=w) invisible(replicate(n, writeLines(paste(runif(sample(minF:maxF, 1)), collapse=,), f))) close(f) f - file(test.csv,

Re: [R] Matrix of dummy variables from a factor

2005-12-06 Thread John Fox
Dear Charles, Try model.matrix(~f)[,-1]. Regards, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message-

Re: [R] R is GNU S, not C.... [was how to get or store .....]

2005-12-06 Thread Ted Harding
On 06-Dec-05 Deepayan Sarkar wrote: [...] The greater readability of the first relative to the second is obvious. The compactness of the second relative to the first is evident. Obtaining the second from the first by repeated J is very quick. I'm curious: exactly what purpose does this

Re: [R] Matrix of dummy variables from a factor

2005-12-06 Thread Uwe Ligges
Charles H. Franklin wrote: What is a simple way to convert a factor into a matrix of dummy variables? fm-lm(y~f) model.matrix(y~f) Uwe Ligges where f is a factor takes care of this in the estimation. I'd like to save the result of expanding f into a matrix for later use. Thanks.

Re: [R] strange behavior of loess() predict()

2005-12-06 Thread Leo Gürtler
Gavin Simpson wrote: Dear list, I am very sorry for being inaccurate in my question. But re-reading the predict.loess help site does not provide a solution. As long as predict is used on a new dataset based on this dataset, the strange values remain and can be reproduced. Adding a new element

Re: [R] Matrix of dummy variables from a factor

2005-12-06 Thread Berton Gunter
But note: There are (almost?) no situations in R where the dummy variables coding is needed. The coding is (almost?) always handled properly by the modeling functions themselves. Question: Can someone provide a straightforward example where the dummy variable coding **is** explicitly needed? --

  1   2   >