Re: [R] r script

2008-11-06 Thread Barry Rowlingson
2008/11/6 Paul Hiemstra [EMAIL PROTECTED]: How can execute a bash command inside the script, like the command for change the directory (cd)? ?system The system function won't work for changing the working directory of R though: getwd() [1] /home/rowlings system(cd /) getwd() [1]

Re: [R] How to detect NULL list element?

2008-11-03 Thread Barry Rowlingson
2008/11/3 [EMAIL PROTECTED]: So how do I detect the NULL at r[1]? How can you detect what is not there? Single square brackets on a list give you a list. Double square brackets give you the elements. is.null(r[[1]]) should be TRUE. Barry __

Re: [R] Goto loop

2008-10-31 Thread Barry Rowlingson
2008/10/31 megh [EMAIL PROTECTED]: Is there anything like goto loop, which exists in most computer programs? Really? Not since 1968, I think: http://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF e.g. I am looking for this kind of stuff : if(i 6) goto step-02 Any idea? Thinking you

Re: [R] Goto loop

2008-10-31 Thread Barry Rowlingson
2008/10/31 Peter Dalgaard [EMAIL PROTECTED]: It doesn't exist, but it can always be replaced by if() {} else {} constructs. (You don't usually see goto in the class of functional programming languages to which R belongs. See also http://en.wikipedia.org/wiki/Edsger_W._Dijkstra .) Also see

Re: [R] License Question

2008-10-28 Thread Barry Rowlingson
2008/10/28 [EMAIL PROTECTED]: To answer your question, we do not distribute R. We distribute R-PLUS. But your web site claims, in big capital letters, that R-plus is THE REAL R. If you are not distributing R (the real real R, (c) The R Foundation), then this could be construed as false

Re: [R] License Question

2008-10-27 Thread Barry Rowlingson
2008/10/27 Freiberger, Katrin [EMAIL PROTECTED]: Dear All, I learned about R during my studies at Cologne University of Applied Science. Now I work at Allianz Dresdner Bauspar AG and I would like to install R here too. Is there any license issues that need to be taken in consideration, any

Re: [R] combining data from different datasets

2008-10-24 Thread Barry Rowlingson
2008/10/24 Gabor Grothendieck [EMAIL PROTECTED]: NA and NA are not the same: DF - data.frame(x = c(a, NA, NA)) DF x 1a 2 NA 3 NA is.na(NA) [1] TRUE is.na(NA) [1] FALSE Yes, but unless you tell it otherwise, read.table will think Namibia is an NA, even in a column of

Re: [R] Simulation of data

2008-10-21 Thread Barry Rowlingson
2008/10/21 Marcioestat [EMAIL PROTECTED]: Hi listers, I am working on a program of statistical analysis of simulated data and I've been searching the error at the program, but I didn't find it! It is something about the WHILE procedure, the error says: Error in while (ecart = d) { : missing

Re: [R] recovering value of scalar from false color map and image

2008-10-18 Thread Barry Rowlingson
2008/10/18 Jan Theodore Galkowski [EMAIL PROTECTED]: I have a JPEG map of temperature data, coded using a given legend where blues are cooler and reds hotter. Is there any preexisting R magic or package which might let me recover the value of the scalar quantity so represented given the RGB

Re: [R] Using source()

2008-10-16 Thread Barry Rowlingson
2008/10/16 Michael Just [EMAIL PROTECTED]: On Thu, 16 Oct 2008, Michael Just wrote: I think I am still a beginner, hence all the questions. I am pretty sure my code has redundancies and I use excel as an text editor, its the fastest way I know how (lots of dragging formulas). I have 1,000's

Re: [R] draw a 5cm x 3cm rectangle

2008-10-16 Thread Barry Rowlingson
2008/10/16 Thomas Steiner [EMAIL PROTECTED]: Hi I want to draw sth in a pdf file with a predefined defined size. Say a 5cm x 3cm rectangle (a ruler): pdf(rect.pdf, paper=a4) plot(c(1,5,5,1,1),c(1,1,3,3,1),asp=1,axes=n) dev.off() but how do I fix that one unit is 1cm? I just did

Re: [R] counting the frequencies of a vector

2008-10-16 Thread Barry Rowlingson
2008/10/16 Jörg Groß [EMAIL PROTECTED]: Hi, Is there a function which counts the frequencies of the occurence of a number within an interval? for example I have this vector: x - c(1, 3, 1.2, 5, 5.9) and I want a vector that gives me the frequencies within an interval of 2, beginning at

Re: [R] Roman numeral question

2008-10-16 Thread Barry Rowlingson
2008/10/16 Erin Hodgess [EMAIL PROTECTED]: Hi R People! Is there a setup for Roman numerals similar to that of LETTERS and letters, please? I was putting together a randomized block design and thought that it might be nice for factors. Thanks, Erin as.roman() in utils:

Re: [R] Conditionally skip over for(..){ and }??

2008-10-12 Thread Barry Rowlingson
2008/10/12 Ted Harding [EMAIL PROTECTED]: Hi Folks, I'm wondering if there's a secret trick to achieve the following. I have some big code for analysis related to a named variable, which will be one of several in the columns of a dataframe, and I would like to be able to choose between a run

Re: [R] [OOPS!]Sexy Little Number :-)-O

2008-10-05 Thread Barry Rowlingson
2008/10/5 Ted Harding [EMAIL PROTECTED]: sexyNo() How puerile. R should be used for serious purposes. Here is a plot that shows a log-log-log feasible region symmetric about x=0, within a sinusoidal left and right-bound envelope: # set up plot xrange=c(-15,15) yrange=c(0,16)

Re: [R] best material for programmers?

2008-09-28 Thread Barry Rowlingson
2008/9/28 June Kim [EMAIL PROTECTED]: Hello, What is the best material(book, pdfs, ...) for programmers, who have extensive experience in other programming languages, to learn R programming? I think there are many materials on how to use R for specific statistical jobs, but I haven't seen

Re: [R] Bug in is ?

2008-09-26 Thread Barry Rowlingson
2008/9/25 Kingsford Jones [EMAIL PROTECTED]: Try ?type which correctly guesses the user is looking for the 'typeof' page. Or even example(type) Also, after a brief introduction, the R Language Definition document begins with a discussion of types. Kingsford Jones But if, oh if,

Re: [R] plot error

2008-09-23 Thread Barry Rowlingson
2008/9/23 glaporta [EMAIL PROTECTED]: HI there, why these lines of code are correct plot(count~spray, data = InsectSprays) plot(InsectSprays$count) but this return an error: plot(count, data = InsectSprays); data method is not implemented in plot?! The 'plot' function, like many

Re: [R] Modifying output to Google Docs

2008-09-23 Thread Barry Rowlingson
2008/9/23 Ajay ohri [EMAIL PROTECTED]: Hi List, Graphical output to PDF's ,RTF ,CSV is known through R. Can it be modified for outputting to Google Docs (which is basically uploaded files ,published to become html pages) Is there any package on this ? Do you basically mean an R

Re: [R] Modifying output to Google Docs

2008-09-23 Thread Barry Rowlingson
2008/9/23 Ajay ohri [EMAIL PROTECTED]: By outputting PDF directly to a Google Doc, it becomes light and portable for people to view and collaborate on projects in different parts of the world. If you extend this to Google spreadsheets this functionality is especially useful for financial

Re: [R] Manage huge database

2008-09-22 Thread Barry Rowlingson
2008/9/22 José E. Lozano [EMAIL PROTECTED]: I wouldn't call a 4GB csv text file a 'database'. It didn't help, sorry. I perfectly knew what a relational database is (and I humbly consider myself an advanced user on working with MSAccess+VBA, only that I've never face this problem with

Re: [R] Manage huge database

2008-09-22 Thread Barry Rowlingson
2008/9/22 José E. Lozano [EMAIL PROTECTED]: Exactly, raw data, but a little more complex since all the 50 variables are in text format, so the width is around 2,500,000. Thanks, I will check. Right now I am reading line by line the file. It's time consuming, but since I will do it only

Re: [R] Manage huge database

2008-09-22 Thread Barry Rowlingson
2008/9/22 jim holtman [EMAIL PROTECTED]: Why don't you make one pass through your data and encode you characters as integers (it would appear that you only have 16 combinations). You might also want to consider using the 'raw' object since these only take up one byte of storage -- will reduce

Re: [R] how to keep up with R?

2008-09-19 Thread Barry Rowlingson
2008/9/19 Wensui Liu [EMAIL PROTECTED]: Dear Listers, I've been a big fan of R since graduate school. After working in the industry for years, I haven't had many opportunities to use R and am mainly using SAS. However, I am still forcing myself really hard to stay close to R by reading

Re: [R] how to draw a vertical line from points to x-axis

2008-09-07 Thread Barry Rowlingson
2008/9/7 Anny Huang [EMAIL PROTECTED]: Hello, I want to know how to draw a line connecting each point to the x-axis perpendicularly (i.e. a vertical line). abline(v=...) seems not to work for my purpose, because it runs over the data point. Can anyone help? Thanks. If your x-axis is at

Re: [R] license for a university

2008-09-04 Thread Barry Rowlingson
2008/9/4 Ted Byers [EMAIL PROTECTED]: Erin, I trust you know what you risk when you assume. ;-) There IS a license, but it basically lets you copy or distribute it, or, in your case, install on as many machines as you wish. It is the GNU GENERAL PUBLIC LICENSE. Like most open source

Re: [R] coloured letters in a text

2008-08-28 Thread Barry Rowlingson
2008/8/28 Fränzi Korner [EMAIL PROTECTED]: example 1: I would like to add the word ABC to a figure. Thereby each letter should have a different colour. text(x,y,ABC, col=c(1,2,3)) # this does not work kludge alert! How about: text(x,y,ABC,col=3) text(x,y,AB,col=2) text(x,y,A,col=1)

Re: [R] Function not returning a vector?

2008-08-28 Thread Barry Rowlingson
2008/8/28 [EMAIL PROTECTED]: hazard - function(x,shape,scale) { return (shape/scale) * (x/scale)^(shape - 1) } Only return a single value? It is like x becomes a single value passed as an argument. It's evaluating return(shape/scale) and returning that! Add some extra parentheses:

Re: [R] Basic question about X11()

2008-08-27 Thread Barry Rowlingson
2008/8/27 Patrick Connolly [EMAIL PROTECTED]: Your question is one relating to your window manager. The display parameter for x11() does not relate to desktops. All the desktops are part of the same display. Some very clever R-devel people might be able to think of a way of making a

Re: [R] Jpg files in R

2008-08-25 Thread Barry Rowlingson
2008/8/25 Henrique Dallazuanna [EMAIL PROTECTED]: Is there the rimage package: if(!require(rimage))install.packages(rimage) x - read.jpeg(system.file(data, cat.jpg, package=rimage)) Nice, but if the require() fails and the package installs via install.packages, you still have to do the

Re: [R] Sending ... to a C external

2008-08-23 Thread Barry Rowlingson
2008/8/22 Emmanuel Charpentier [EMAIL PROTECTED]: Le vendredi 22 août 2008 à 15:16 -0400, John Tillinghast a écrit : I'm trying to figure this out with Writing R Extensions but there's not a lot of detail on this issue. I want to write a (very simple really) C external that will be able to

Re: [R] pdf filenames in while loop

2008-08-20 Thread Barry Rowlingson
2008/8/20 Wesley Roberts [EMAIL PROTECTED]: Dear R users, pdf(file=as.character(paste(f.mat[a])).pdf) Whoa! Why the quotes? And why the as.character? Just paste: pdf(file=paste(f.mat[a],.pdf,sep=)) should do it. It looks like you were trying to create a file called as.character(...etc.

Re: [R] How to send Html using SQL Server db mail

2008-08-20 Thread Barry Rowlingson
2008/8/20 Bos, Roger [EMAIL PROTECTED]: All, I have a variable called `go` and it has a single quote in the name column of line 47 that I am trying to get rid of. I have tried using gsub, but I cannot get the syntax correct to tell R to remove the ' (single quote). go[47,] gvkey

Re: [R] how to get no of pdf files in a particular directory

2008-08-18 Thread Barry Rowlingson
2008/8/18 Kurapati, Ravichandra (Ravichandra) [EMAIL PROTECTED]: Dir-/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_01_ 08_18_08 There will be pdf and/or csv files. I want to know how many *.pdf files are there in that directory. How can I get using

Re: [R] rgl/compiz problem

2008-08-14 Thread Barry Rowlingson
2008/8/14 Marc Schwartz [EMAIL PROTECTED]: I think it's an Ubuntu bug, because nothing like it occurs anywhere else. So I'd suggest you turn off compiz or switch to a reliable OS like Windows ;-). Gack... ;-) What do you recommend for multiple desktops in Windows? I've currently got six

[R] rgl/compiz problem

2008-08-13 Thread Barry Rowlingson
I have just encountered the problem with rgl where plot3d figures don't interact with the mouse. My plots zoom in and out with the mouse wheel but the mouse buttons do nothing. I can't rotate the plot. This has been mentioned and discussed here and in other lists before, and the solution is to

Re: [R] rgl/compiz problem

2008-08-13 Thread Barry Rowlingson
2008/8/13 Ben Bolker [EMAIL PROTECTED]: Barry Rowlingson b.rowlingson at lancaster.ac.uk writes: I have just encountered the problem with rgl where plot3d figures don't interact with the mouse. My plots zoom in and out with the mouse wheel but the mouse buttons do nothing. I can't rotate

Re: [R] Problem with using read.csv with web address

2008-08-12 Thread Barry Rowlingson
2008/8/12 Aiste Aistike [EMAIL PROTECTED]: Hello, I have a problem with using read.csv(). I want to read a table from the ONS neighborhood statistics website which has an address:

Re: [R] Compiling only some C files

2008-08-11 Thread Barry Rowlingson
2008/8/11 Lafaye de Micheaux Pierre [EMAIL PROTECTED]: I would like to be able to choose which *.cpp files will be compiled and to exclude some *.cpp files from the compilation. This is because some of my *.cpp files contain #include instructions calling some other *.cpp file. For example,

Re: [R] tkentry that exits after RETURN?

2008-08-11 Thread Barry Rowlingson
2008/8/11 Ben Bolker [EMAIL PROTECTED]: I can set up an entry widget (thanks to an old post by Barry Rowlingson) that gets a password and exits when the user clicks on the OK button. Who? Oh dear, my past comes back to haunt me... getPassword - function(){ require(tcltk) tt

Re: [R] tkentry that exits after RETURN?

2008-08-11 Thread Barry Rowlingson
2008/8/11 Ben Bolker [EMAIL PROTECTED]: I can set up an entry widget (thanks to an old post by Barry Rowlingson) that gets a password and exits when the user clicks on the OK button. Who? Oh dear, my past comes back to haunt me... getPassword - function(){ require(tcltk) tt

Re: [R] tkentry that exits after RETURN?

2008-08-11 Thread Barry Rowlingson
2008/8/11 Ben Bolker [EMAIL PROTECTED]: I can set up an entry widget (thanks to an old post by Barry Rowlingson) that gets a password and exits when the user clicks on the OK button. Who? Oh dear, my past comes back to haunt me... getPassword - function(){ require(tcltk) tt

Re: [R] Converting english words to numeric equivalents

2008-07-28 Thread Barry Rowlingson
2008/7/28 Rolf Turner [EMAIL PROTECTED]: On 28/07/2008, at 12:32 PM, oscar Linares wrote: Hello, I am trying to convert english words to numeric equivalents, e.g., abc to 123. Is there a function or library or package for doing this in R? If not, can it be done easily in R? Your question

Re: [R] Table orderd by frequencies

2008-07-22 Thread Barry Rowlingson
2008/7/22 Kunzler, Andreas [EMAIL PROTECTED]: Dear List, I try to order the output of a table by the frequencies of the vector I am look at. The object I am looking at is a factor with a lot of levels that were named only once. Therefore it would be much easier to order the output by the

Re: [R] Labelling curves on graphs

2008-07-16 Thread Barry Rowlingson
2008/7/16 Ted Harding [EMAIL PROTECTED]: Hi Folks, I'd be grateful for good suggestions about the following. I'm plotting a family of (X,Y) curves (for different levels of another variable, Z): say 6 curves in all but could be more or less -- it's a rather variables situation. I'd like to

Re: [R] Need help to draw a plot

2008-06-23 Thread Barry Rowlingson
Ron Michael wrote: can i have some instruction on how to draw this type of plot in R : http://sitmo.com/doc/Image:Ll_ou_conpron.png#filelinks ? Regards, The black curve and it's grey friends are probably easily done with plot or matplot, but you need to make sure the X-axis extends far

Re: [R] the title is too long for a graph

2008-06-10 Thread Barry Rowlingson
Hua Li wrote: Hi All, I have a problem of putting long titles on a graph: for example, x= seq(1:100) y=seq(1:100) plot(x,y,main=p=0.05:A-B=3,C-D=10,D-E=100,A-F=2,AFR-E=3,ACE-D=1,ADEF-M=0,AED-E=10,DE-F=3,AB-J=4,AC-J=10,ED-F=1,ED-B=4,AF-B=10,CD-S=10,AM-C=4) R seems not able to print the whole

Re: [R] sum of unknown number of matrices

2008-06-04 Thread Barry Rowlingson
Shubha Vishwanath Karanth wrote: I need: a+b+c+d [,1] [,2] [1,]4 12 [2,]8 16 Something like do.call(+,l) is not working...why is this? Because do.call constructs a function call with the elements of l as arguments, so you end up with: +(1:4, 1:4, 1:4, 1:4) but

Re: [R] Research Notes

2008-04-22 Thread Barry Rowlingson
Tom Chr Backer Johnsen wrote: I can at best say that this question is related to R. What has become more and more obvious to me after I started using R about two years ago is that I have collected a large number of data files, scripts, and workspaces (.Rdata files) in several catalogs on

Re: [R] Research Notes

2008-04-22 Thread Barry Rowlingson
JRG wrote: You might consider Treepad Lite (www.treepad.com). It's a tiny, free-form tree-structured notebook/database/text editor. It stores stuff as plain text, so you can easily copy/paste to other software. It's available for Windows and Linux, and it's free --- though more

Re: [R] RPy

2008-04-21 Thread Barry Rowlingson
Doran, Harold wrote: I'm curious if there are users of RPy on this list. I've recently created a gui front end using Tkinter for some python scripts I've written for some of our internal operations and I am quite pleased with how this program works. Currently, I can use py2exe to create a

Re: [R] Blank windows in Rcmdr

2008-04-16 Thread Barry Rowlingson
John Fox wrote: Dear Fehmi, Curiously, I check the Rcmdr package on an up-to-date Ubuntu 7.10 system running R 2.6.2. I've just checked again after updating both Ubuntu and all R packages, and I can't duplicate your problem -- the Tools - Load packages menu works fine for me, as does

Re: [R] Loop for in R to generate several variables

2008-04-07 Thread Barry Rowlingson
Gustaf Rydevik wrote: On Mon, Apr 7, 2008 at 11:31 AM, arpino [EMAIL PROTECTED] wrote: Hi everybody, I have to create several variables of this form: Yind = L0 + L1*X1 + L2*X2 + L3*X3 + K*Cind + n where ind varires in {1,...,10} look up ?assign and ?get, i.e: for (ind in 1:10) {

Re: [R] YAML parser for R in Windows

2008-02-22 Thread Barry Rowlingson
Albicelli, Nicholas (Exchange) wrote: How can I parse a YAML file in R 2.6.0 in Windows? I cannot get the RYaml package to compile in Windows, I can't find a MinGW compiled .dll for an existing YAML parser like syck (which would appear to be the best hope for creating my own R wrapper

Re: [R] History of R

2008-02-20 Thread Barry Rowlingson
Earl F. Glynn wrote: Nearly six years ago, SAS also refused to give us academic pricing because we were not a degree granting institution. About a year ago, SAS finally granted us academic pricing, but most of the analysis momentum was already for the use of R/Bioconductor. I recently

Re: [R] Reorder data frame columns by negating list of names

2008-02-12 Thread Barry Rowlingson
Thompson, David (MNR) wrote: Hello, I would like to reorder columns in a data frame by their names as demonstrated below: Take this data frame: xxx - data.frame(matrix(1:40, ncol=8)) names(xxx) - letters[1:8] xxx a b c d e f g h 1 1 6 11 16

Re: [R] precision in seq

2008-02-05 Thread Barry Rowlingson
Prof Brian Ripley wrote: FAQ Q7.31 and ?== should enlighten you. None of 0.05, 0.1 ... 0.9, 0.95 are exactly representable on a binary computer. Doesn't the string 0.95 constitute an exact representation? And my computer is definitely binary. Although I suspect it is also bipolar.

Re: [R] help with oop in R - class structure and syntex

2008-02-05 Thread Barry Rowlingson
Duncan Murdoch wrote: Another problem is that there are two different class systems in R: sometimes calls S3 and S4 (because of the versions of S where they were introduced). You were reading about S3. There's three different class systems if you also include the R.oo add-on package[1].

Re: [R] how to generate sequence a - z

2008-01-29 Thread Barry Rowlingson
Bernd Weiss wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 skestin schrieb: | I suppose it's very simple but I can't find the way to generate a sequence of | characters, e.g. from a to z. | Could you please help me with this? ?letters letters letters is okay for just that

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Barry Rowlingson
Clint Bowman wrote: So how does SAS compare with one of the specialty languages such as perl. I've found the combination of perl and R to work quite satisfactorily (as long as I don't confuse the syntax and functions available in each.) Now that the topic has drifted off the subject of what

Re: [R] How to interrupt a loop by pressing a key?

2008-01-15 Thread Barry Rowlingson
Bruno Jesus wrote: So... back to the initial question. Can I break the cycle with a signal from the keyboard? The following code, slightly modified from: http://www.sciviews.org/_rgui/tcltk/OKCancelDialog.html lets you interrupt an analysis by clicking on a dialog box, using the tcltk

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Barry Rowlingson
Lauri Nikkinen wrote: R-users, Is there a function for ceiling to the nearest ten? a - 1:10*4 a [1] 4 8 12 16 20 24 28 32 36 40 The resulting vector should look like this (ceiling to the nearest ten) [1] 10 10 20 20 20 30 30 40 40 40 Divide and conquer: a [1] 4 8 12 16

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Barry Rowlingson
Rob Robinson wrote: Perhaps not the most elegant but 10*ceiling(x/10) usually works for me... I thought maybe adding five and rounding to the nearest -1 decimal places might be quicker: round(a+5,-1) [1] 10 10 20 20 20 30 30 40 40 40 gives same as: ceiling(a/10)*10 [1] 10 10

Re: [R] An R is slow-article

2008-01-09 Thread Barry Rowlingson
Gustaf Rydevik wrote: Hi all, Reading the wikipedia page on R, I stumbled across the following: http://fluff.info/blog/arch/0172.htm It does seem interesting that the C execution is that much slower from R than from a native C program. Could any of the more technically knowledgeable

Re: [R] rainbow function

2008-01-07 Thread Barry Rowlingson
Wang, Zhaoming (NIH/NCI) [C] wrote: Hello I'm using rainbow function to generate 10 colors for the plot and it is difficult to tell the neighboring colors from each other. How can I make the colors more differently. If all you want is for neighbouring colours to be distinguishable you

Re: [R] Polynomial fitting

2008-01-07 Thread Barry Rowlingson
Dimitris Rizopoulos wrote: try this: y - c(15.51, 12.44, 31.5, 21.5, 17.89, 27.09, 15.02, 13.43, 18.18, 11.32) x - seq(3.75, 6, 0.25) coef(lm(y ~ x + I(x^2) + I(x^3))) Or use the 'poly' function: coef(lm(x~poly(y,3))) (Intercept) poly(y, 3)1 poly(y, 3)2 poly(y, 3)3 4.875

Re: [R] a problem.

2008-01-02 Thread Barry Rowlingson
August Washington wrote: I meet a problem about my R code. I find the output of my R code is different from the result several months ago. Do anybody meet this situation and how to explain? Not me, the square root of 2 is pretty much the same it was last year. Possibilities, in the

Re: [R] Is R portable?

2007-12-05 Thread Barry Rowlingson
Peter Dalgaard wrote: The toolchain availability tends to get in the way. Linux-based gadgets could prove easier. I do wonder from time to time whether there really is a market for R on cellphones... As soon as someone writes library(ringtone) there might be :) And I think you'd have to

Re: [R] Replacing values job

2007-11-28 Thread Barry Rowlingson
jim holtman wrote: ?match X [1] 2 6 1 7 4 3 5 Y [1] 1 1 6 4 6 1 4 1 2 3 6 6 1 2 4 4 5 4 1 7 6 6 4 4 7 1 2 match(Y,X) [1] 3 3 2 5 2 3 5 3 1 6 2 2 3 1 5 5 7 5 3 4 2 2 5 5 4 3 1 I quite like this solution: X[X[X[X[X[X[X[X[X[X[X]][Y] [1] 3 3 2 5 2 3 5 3 1 6 2 2 3 1 5 5

Re: [R] spatial overlap of datasets

2007-11-19 Thread Barry Rowlingson
Barry Rowlingson wrote: If any of the points of A fall inside B or vice versa then the convex hulls overlap. Pah, I'm wrong. View this with a fixed-width font: 21 2 11 21 2 convex hull of 1 and 2 overlap, yet no points of either are inside

Re: [R] R as a programming language

2007-11-08 Thread Barry Rowlingson
hadley wickham wrote: You're assuming an automatic cast from numbers into strings? What if a + 4 threw an error? What's wrong with commas anyway when using cat(): cat(x is ,x,' and y is ',y,'\n',sep='') x is 1 and y is 2 and there's always sprintf() for those moments when you want

<    2   3   4   5   6   7