[R] Question on .Options$max.print

2006-08-14 Thread Hans-Joerg Bibiko
Hi, I have a tiny question concerning .Options$max.print I have to set up this value to a greater value than 1 because I want to concatenate my output of a function to one single string (for connivence). I did this via .Options$max.print - 64000 or options(max.print=64000) Then I

Re: [R] Question on .Options$max.print - print/cat extremely long strings on a screen

2006-08-15 Thread Hans-Joerg Bibiko
Dear list members, sorry for my incompleteness! My problem is the following: (R 2.3.1 on Mac OS X 10.4.7 RAM 1GByte using Mac GUI) I have a function like this: foo1 - function() { out - NULL for(i in 1:10010) out - paste(out, i, . line\n, sep=) return(out) } a -

[R] Query the kind of calling a funcion

2006-08-15 Thread Hans-Joerg Bibiko
Dear all, My question is concerned to the kind how a function is called. Example A: foo(1) Example B: a - foo(1) Is there any way for the function foo() to recognise whether the returned value of foo() is stored in a variable or not, i.e. to distinguish between Example A and B?

[R] Problem with the special argument '...' within a function

2006-08-16 Thread Hans-Joerg Bibiko
Dear all, I wrote some functions using the special argument '...'. OK, it works. But if I call such a function which also called such a function, then I get an error message about unused arguments. Here's an example: fun1 - function(x,a=1) { print(paste(x=,x))

Re: [R] advice on exporting a distance matrix in the correct format needed please

2006-08-16 Thread Hans-Joerg Bibiko
In order to get a table structure out of a dist object use 'as.matrix ()' like 'as.matrix(dist(myMatrix))' and write.table(). Hans On 16 Aug 2006, at 14:46, Ffenics wrote: Hi there Could anyone please tell me how to export a distance matrix to a .csv file please? when I tried

Re: [R] Problem with the special argument '...' within a function

2006-08-16 Thread Hans-Joerg Bibiko
Quoting Liaw, Andy [EMAIL PROTECTED]: I'm not sure if this is what you want, but simply add ... to the list of arguments for fun1 and fun2 would eliminate the error. Andy That's it!! Thank you very much!! Best, Hans Dear all, I wrote some functions using the special argument '...'.

Re: [R] Substring and strsplit

2006-08-30 Thread Hans-Joerg Bibiko
If you are using 'only' English then str - dog strsplit(str,NULL)[[1]] works perfectly and it is fast. But if you also dealing with Unicode character have a look at http://wiki.r-project.org/rwiki/doku.php?id=tips:data- strings:decomposestring Cheers, Hans you can also use substring(),

Re: [R] converting decimal - hexadecimal

2006-08-30 Thread Hans-Joerg Bibiko
the posting guide http://www.R-project.org/posting- guide.html and provide commented, minimal, self-contained, reproducible code. ** Hans-Joerg Bibiko Max Planck Institute for Evolutionary Anthropology Department of Linguistics Deutscher

Re: [R] Substring and strsplit

2006-09-01 Thread Hans-Joerg Bibiko
On 1 Sep 2006, at 08:22, Prof Brian Ripley wrote: On Wed, 30 Aug 2006, Hans-Joerg Bibiko wrote: If you are using 'only' English then str - dog strsplit(str,NULL)[[1]] works perfectly and it is fast. It does also work 'perfectly' and fast in 'Unicode' in all major European and CJK

[R] R 2.3.1 on Mac OSX: apply a function to 'dist()' ?

2006-07-05 Thread Hans-Joerg Bibiko
Dear all, maybe there is someone who has an hint for me. I have to calculate a distance matrix by using my own function to get the distance between two rows of my matrix. The normal way to do this is to use two 'for loops' like for(i in 1:nrow) for(j in i:nrow)

Re: [R] R 2.3.1 on Mac OSX: apply a function to 'dist()' ?

2006-07-05 Thread Hans-Joerg Bibiko
Dear Sarah, many thanks for the hint. Unfortunately my distance metric is more complex. For me it is not only important to know whether there is a change between rows but also to know where (which column) the change occurs and furthermore to know if there is a change in e.g. column 5 to

Re: [R] engineering notation format

2006-07-07 Thread Hans-Joerg Bibiko
= 125E-12 ? Hans ** Hans-Joerg Bibiko Max Planck Institute for Evolutionary Anthropology Department of Linguistics Deutscher Platz 6 phone: +49 (0) 341 3550 341 D-04103 Leipzig fax: +49 (0) 341 3550 333 Germany e

[R] VERY TINY question: missing function to clear the console?

2006-07-13 Thread Hans-Joerg Bibiko
Hi, for presentation purposes I would like to clear to whole console window (like in a UNIX terminal: 'clear'). Is there such a function? If not, I could image that is not too hard to write such a function. Cheers, Hans __

Re: [R] VERY TINY question: missing function to clear the console?

2006-07-13 Thread Hans-Joerg Bibiko
Sorry, I forgot to mention that I'm using R 2.3.1 on Mac OSX 10.4.7 via R.app GUI. On 13 Jul 2006, at 12:53, Joris De Wolf wrote: ctrl+l Thanks, but unfortunately this doesn't work on my Mac. Hans Hi, for presentation purposes I would like to clear to whole console window (like in

Re: [R] VERY TINY question: missing function to clear the console?

2006-07-13 Thread Hans-Joerg Bibiko
Hi, many thanks for the hints! Hi, for presentation purposes I would like to clear to whole console window (like in a UNIX terminal: 'clear'). Is there such a function? If not, I could image that is not too hard to write such a function. At the risk of this being a stupid answer: An

Re: [R] String manipulation and formatting

2006-07-18 Thread Hans-Joerg Bibiko
Hi, an other way without any libraries and written as a one-line-command would be something like this: xify - function(x) { gsub([0-9],X, sprintf( paste( %, ifelse(

Re: [R] String manipulation and formatting

2006-07-18 Thread Hans-Joerg Bibiko
Hi, only if you allow to input x as a string then you can use, maybe, simply the following one-line-command: xify - function(x) { gsub( [0-9], X, sprintf( paste(%,ifelse(regexpr(\\.,x) 0, x, x-paste(x,. 0,sep=)),