[R] Towards genetic programming...

2007-08-02 Thread Atte Tenkanen
in, see http://rgeneticprogramming.blogspot.com/ Atte Tenkanen University of Turku __ 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

[R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
5 11 1 [1] 8 4 9 2 10 5 11 1 [1] 8 4 9 2 10 5 11 1 3 Error in if (is.na(v[i]) == FALSE is.null(unlist(v[i])) == FALSE) { : argument is of length zero Regards, Atte Tenkanen University of Turku, Finland __ R-help

Re: [R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
11 1 3 Error in if (is.na(v[i]) == FALSE is.null(unlist(v[i])) == FALSE) { : argument is of length zero Regards, Atte Tenkanen University of Turku, Finland __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman

Re: [R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
On 15/07/2007 10:06 AM, Atte Tenkanen wrote: Hi, Is it possible to break using if-condition during the recursive function? You can do if (condition) return(value) Here is a function which almost works. It is for inorder-tree- walk. iotw-function(v,i,Stack,Indexes

Re: [R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
On 15/07/2007 10:33 AM, Atte Tenkanen wrote: On 15/07/2007 10:06 AM, Atte Tenkanen wrote: Hi, Is it possible to break using if-condition during the recursive function? You can do if (condition) return(value) Here is a function which almost works. It is for inorder-tree

Re: [R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
;-) Atte - Original Message - From: hadley wickham [EMAIL PROTECTED] Date: Sunday, July 15, 2007 6:58 pm Subject: Re: [R] Break during the recursion? On 7/15/07, Duncan Murdoch [EMAIL PROTECTED] wrote: On 15/07/2007 11:36 AM, Atte Tenkanen wrote: On 15/07/2007 10:33 AM, Atte Tenkanen

Re: [R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
TNX Hadley! Atte - Original Message - From: hadley wickham [EMAIL PROTECTED] Date: Sunday, July 15, 2007 11:04 pm Subject: Re: [R] Break during the recursion? On 7/15/07, Atte Tenkanen [EMAIL PROTECTED] wrote: Here is now more elegant function for inorder tree walk, but I still

Re: [R] is.null doesn't work

2007-07-12 Thread Atte Tenkanen
Seems to work, if I unlist the argument at first ;-) Atte Hi, What's wrong here?: v=c(`-`,`+`,1,`^`,`^`,NA,NA,X,9,X,2) i2=16 v[i2] [[1]] NULL is.null(v[i2]) [1] FALSE Is it a bug or have I misunderstood something? Atte Tenkanen University of Turku, Finland

[R] is.null doesn't work

2007-07-12 Thread Atte Tenkanen
Hi, What's wrong here?: v=c(`-`,`+`,1,`^`,`^`,NA,NA,X,9,X,2) i2=16 v[i2] [[1]] NULL is.null(v[i2]) [1] FALSE Is it a bug or have I misunderstood something? Atte Tenkanen University of Turku, Finland __ R-help@stat.math.ethz.ch mailing list

[R] from character string to function body?

2007-07-07 Thread Atte Tenkanen
this? Cheers, Atte Tenkanen University of Turku, Finland __ 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

Re: [R] from character string to function body?

2007-07-07 Thread Atte Tenkanen
Thanks Sundar! I wonder that - when evaluating F1 - the right mathematical formula is now also printed! F1 function (x) x^3 + x^2 - 1 Atte Atte Tenkanen said the following on 7/7/2007 8:41 AM: Dear R users, I wonder if it is possible to form a function from a character string

[R] New function combinations using tree structures?

2007-07-04 Thread Atte Tenkanen
Hi everybody, I'm still interesting the possibility to use R for genetic programming (see https://stat.ethz.ch/pipermail/r-help/2007-April/128782.html) and I'd like to know, how to express for instance this kind of functions (x^2+3x+1 etc, see the picture) using some kind of tree structures and

[R] Transfer entropy not implemented in R?

2007-05-21 Thread Atte Tenkanen
Hi, I couldn't find the 'transfer entropy' implemented in any R packages. I can't follow the math needed here (www.macalester.edu/~kaplan/knoxville/PRL00461.pdf). If it is not implemented, could somebody do it? Or write a garage level code for testing purposes? Atte Tenkanen

Re: [R] A function for raising a matrix to a power?

2007-05-09 Thread Atte Tenkanen
: Monday, May 07, 2007 5:16 PM To: Atte Tenkanen Cc: r-help@stat.math.ethz.ch Subject: Re: [R] A function for raising a matrix to a power? You might try this, from 9/22/2006 with subject line Exponentiate a matrix: I am getting a bit rusty on some of these things, but I seem

[R] A function for raising a matrix to a power?

2007-05-06 Thread Atte Tenkanen
Hi, Is there a function for raising a matrix to a power? For example if you like to compute A%*%A%*%A, is there an abbreviation similar to A^3? Atte Tenkanen A=rbind(c(1,1),c(-1,-2)) A [,1] [,2] [1,]11 [2,] -1 -2 A^3 [,1] [,2] [1,]11 [2,] -1 -8

[R] About autocorrelation

2007-04-30 Thread Atte Tenkanen
Hello R-users, I'd like to know if there is an autocorrelation function for cases when the time differences between the observations vary? I want to give both the time points (x) and values (y) for the function and get as an output an estimation of autocorrelation. Atte Tenkanen University

Re: [R] R-OSX error: 'memory not mapped'

2007-04-18 Thread Atte Tenkanen
On Wed, 18 Apr 2007, Atte Tenkanen wrote: I often get a following error with R *** caught segfault *** address 0x78807e00, cause 'memory not mapped' Possible actions: 1: abort (with core dump) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace

Re: [R] Fractals with R

2007-04-18 Thread Atte Tenkanen
=.) ## Atte Tenkanen wrote: Hi, That is of counter for web page. Do you get some pop-up windows? Atte Hi Atte, __ R-help

Re: [R] Fractals with R

2007-04-18 Thread Atte Tenkanen
) } } #??? plot(PointsMatrix[,1], PointsMatrix[,2], xlim=Limits, ylim=Limits, col=cl[PointsMatrix[,3]], pch=.) #--- -# Atte Tenkanen wrote: Hi, That is of counter for web

[R] R-OSX error: 'memory not mapped'

2007-04-17 Thread Atte Tenkanen
. Is there something to d0? Atte Tenkanen __ 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

Re: [R] Fractals with R

2007-04-13 Thread Atte Tenkanen
Hi, That is of counter for web page. Do you get some pop-up windows? Atte kone wrote: Hi everybody, I put some R-code to a web page for drawing fractals. See http://fractalswithr.blogspot.com/ If you have some R-code for fractal images, I'm willing to include them to

Re: [R] Fractals with R

2007-04-13 Thread Atte Tenkanen
Hi Jeff, Thank you for the nice page. I also have done some R-videos combining jpeg's in video editor (or with mjpegtools) but this kind of command in R would be useful. Unfortunately I couldn't install NRart-package but got a lot of fun when playing with your Start Making Art!-page. I

[R] Scatterplot3d-proposal

2007-01-23 Thread Atte Tenkanen
? Sometimes it is not easy to distinguish objects behind the others and for instance in this example picture the case nr. 21 is important. Atte Tenkanen University of Turku, Finland __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman

Re: [R] Scatterplot3d-proposal

2007-01-23 Thread Atte Tenkanen
Duncan Murdoch wrote: On 1/23/2007 6:38 AM, Atte Tenkanen wrote: Hi, Does somebody know if there is some trick to betoken the starting points (on the floor) of the vertical lines in scatterplot3d-plots. I'd prefer something like that one in the example here http

Re: [R] MDS in 3D

2007-01-08 Thread Atte Tenkanen
Oh, it was nearer than I have thought! Thanks. Atte I have tried to develop multidimensional scaling for 3D space using PCA without success, yet;-) Is there some application ready in R? Yes. stats has cmdscale. MASS has sammon and isoMDS. All three have a 'k' argument to

[R] MDS in 3D

2007-01-07 Thread Atte Tenkanen
Hi, I have tried to develop multidimensional scaling for 3D space using PCA without success, yet;-) Is there some application ready in R? Cheers, Atte __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] MDS in 3D

2007-01-07 Thread Atte Tenkanen
Hi, I have tried to develop multidimensional scaling for 3D space using PCA without success, yet;-) Is there some application ready in R? Cheers, Atte I found xgobi, but when I try to run example I get some command not found -errors. Atte data(morsecodes) ## from the

Re: [R] MDS in 3D

2007-01-07 Thread Atte Tenkanen
...and my system is OSX 10.4. Atte Hi, I have tried to develop multidimensional scaling for 3D space using PCA without success, yet;-) Is there some application ready in R? Cheers, Atte I found xgobi, but when I try to run example I get some command not found

[R] Hershey fonts for musical notation?

2007-01-03 Thread Atte Tenkanen
=i) } it is enough. Best wishes, Atte Tenkanen University of Turku, Finland ___ P.S. By the way, right now the demo(Hershey) seems not to work in OSX version R 2.4.1. ... I get a message i - i + 1 Error in deparse(ei, control = c

Re: [R] Hershey fonts for musical notation?

2007-01-03 Thread Atte Tenkanen
with Finale or other music notation program. Atte Hi, Atte De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Atte Tenkanen Envoyé : mercredi 3 janvier 2007 09:17 Hi, I'd like to know if it is possible to use Hershey vector fonts to create very primitive

Re: [R] The most common row in a matrix?

2006-11-19 Thread Atte Tenkanen
). Atte Tenkanen University of Turku, Finland __ 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

Re: [R] Row comparisons to a new matrix?

2006-10-07 Thread Atte Tenkanen
/R/help/05/04/3709.html On 10/6/06, Atte Tenkanen [EMAIL PROTECTED] wrote: Hi, Can somebody tell me, which is the fastest way to make comparisons between all rows in a matrix (here A) and put the results to the new symmetric matrix? I have here used cosine distance as an example

Re: [R] Row comparisons to a new matrix?

2006-10-07 Thread Atte Tenkanen
.html On 10/6/06, Atte Tenkanen [EMAIL PROTECTED] wrote: Hi, Can somebody tell me, which is the fastest way to make comparisons between all rows in a matrix (here A) and put the results to the new symmetric matrix? I have here used cosine distance as an example, but the comparison function can

[R] Row comparisons to a new matrix?

2006-10-06 Thread Atte Tenkanen
),c(-1,2),c(5,6)) M=matrix(nrow=length(A[,1]),ncol=length(A[,1])) for(i in 1:length(A[,1])) { for(j in 1:length(A[,1])) { M[i,j]=cosine(A[i,],A[j,]) } } Atte Tenkanen University of Turku, Finland __ R-help

Re: [R] Row comparisons to a new matrix?

2006-10-06 Thread Atte Tenkanen
PROTECTED] On Behalf Of Atte Tenkanen Sent: Friday, October 06, 2006 1:54 PM To: r-help@stat.math.ethz.ch Subject: [R] Row comparisons to a new matrix? Hi, Can somebody tell me, which is the fastest way to make comparisons betweenall rows in a matrix (here A) and put the results to the new

[R] Geometric pattern matching with R?

2006-10-02 Thread Atte Tenkanen
Hi, Is there some package or function for 2- or 3 -dimensional geometric pattern matching with R? It should be measure similarities between patterns in a fuzzy way, so not exact similarities are demanded. Atte Tenkanen University of Turku, Finland

Re: [R] Modifying the embed-results

2006-08-26 Thread Atte Tenkanen
in rows. VECTOR is always scanned forward as long as the number of items (here 5) becomes full. Atte Try: embed(VECTOR, 5)[,5:1] On 8/25/06, Atte Tenkanen [EMAIL PROTECTED] wrote: Hi, Here is a vector and the result from the embed-command: VECTOR=c

Re: [R] Modifying the embed-results

2006-08-26 Thread Atte Tenkanen
length and in the case that VECTOR has fewer than 5 unique elements. On 8/26/06, Atte Tenkanen [EMAIL PROTECTED] wrote: Again my example was't very clear: there were not enough same numbers in the VECTOR. What I need is something like this: VECTOR-c(0,3,6,3,11,2,11,4,3,4,7,7,6,4,8

[R] Modifying the embed-results

2006-08-25 Thread Atte Tenkanen
] 7 6 4 5 10 [1] 6 4 5 10 2 [1] 4 5 10 2 3 [1] 5 10 2 3 8 [1] 10 2 3 5 8 Every row consists of next five unique(!) member of the VECTOR. I made this example result with a time consuming algorithm which uses for-loops and whiles. How to do this better?? Thanks in advance! Atte

Re: [R] Successive subsets from a vector?

2006-08-22 Thread Atte Tenkanen
); ADDRESSES=c(); You do not need the semicolons, and they just confuse readers. for(i in 1:(length(VECTOR)-4)){ ADDRESSES[i]=paste(VECTOR[i:(i+4)],collapse=) } ADDRESSES [1] 14265 42650 265011 6501110 5011104 0111043 1110436 104368 [9] 43686 Atte Tenkanen

[R] A matrix problem

2006-08-19 Thread Atte Tenkanen
=rbind(RESULTMATRIX,RESULTVECTOR) } row.names(RESULTMATRIX)-INDEXES; RESULTMATRIX=RESULTMATRIX[,2]; RESULTMATRIX 1 2 5 8 1 1 Atte Tenkanen University of Turku, Finland __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] A matrix problem

2006-08-19 Thread Atte Tenkanen
Thanks for both, tapply seems to be a fast and delicate solution. I had appr. 150 000 rows and it took few seconds to get the result. Till now I have been too tied by for-loops. I will make acquaintance with An Introduction to R. Atte - Original Message - From: Richard M. Heiberger

[R] How to remove similar successive objects from a vector?

2006-08-16 Thread Atte Tenkanen
[1] 3 2 4 5 3 5 1 6 ___ Atte Tenkanen University of Turku, Finland __ 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

Re: [R] How to change the margin widths in png-plots?

2006-06-19 Thread Atte Tenkanen
) # an asterisk... dev.off(); What do I do next? Atte Tenkanen, Turku Finland __ 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

[R] Border line width?

2006-06-19 Thread Atte Tenkanen
Is there some way to change the line widths of plot borders? I couldn't find any parameters for that purpose. Atte Tenkanen University of Turku, Finland __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Border line width?

2006-06-19 Thread Atte Tenkanen
TNX Brian! Atte - Original Message - From: Prof Brian Ripley [EMAIL PROTECTED] Date: Monday, June 19, 2006 10:33 am Subject: Re: [R] Border line width? On Mon, 19 Jun 2006, Atte Tenkanen wrote: Is there some way to change the line widths of plot borders? I couldn't find any

[R] How to change the margin widths in png-plots?

2006-06-14 Thread Atte Tenkanen
=2, line=0, padj=-1.8,at=1.2, cex=3) lines(Compo_SD_succ_int_array_vector,col=1,lty=1,lwd=2); text(2,0.93,labels=*,cex=3) # an asterisk... dev.off(); What do I do next? Atte Tenkanen, Turku Finland __ R-help@stat.math.ethz.ch mailing list https

[R] How to replace some output candidates in a function?

2006-03-24 Thread Atte Tenkanen
(b))[1]]) Pf=c() # the winner set is transposed to prime form Pf[1]=0 for(i in 1:(length(succ_i_arr)-1)) { Pf[1+i]=Pf[i]+m[i] } } return(Pf) } #**# Atte Tenkanen

[R] How to divide too long labels?

2006-03-18 Thread Atte Tenkanen
)]) # according to Larry Solomon's table http://solomonsmusic.net/pcsets.htm Chordnames is a long vector with long character strings. Atte Tenkanen University of Turku Finland __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] How to divide too long labels?

2006-03-18 Thread Atte Tenkanen
Thank you for answering, both Roger and Henrik There are only 5 cases which need divisions, so I inserted \n to them and now everything works. Atte On 3/18/06, Atte Tenkanen [EMAIL PROTECTED] wrote: Is there any possibility to divide too long text in a plot to two or more lines, when using

[R] How to read more than 1 table?

2006-02-20 Thread Atte Tenkanen
Question 1) I want to read many csv-tables and run the same commands for all of them. Is there some simpler solution than this below to solve this problem? for (g in 1:6) { if (g==1){k=kt1_0057} if (g==2){k=kt1_0101} if (g==3){k=kt1_0613} if (g==4){k=staten} if (g==5){k=tenpenny} if

Re: [R] How to generate pitch strings

2006-02-04 Thread Atte Tenkanen
If I calculate a transition probability matrix, first order markov 12x12 or second order 144x144 from musical pitch classes (0-11), is it possible to generate pitch class strings similar as those original strings using those probability matrix with R? If, how? Atte Tenkanen, Turku, Finland

[R] How to generate pitch strings

2006-02-03 Thread Atte Tenkanen
If I calculate a transition probability matrix, first order markov 12x12 or second order 144x144 from musical pitch classes (0-11), is it possible to generate pitch class strings similar as those original strings using those probability matrix with R? If, how? Atte Tenkanen, Turku, Finland

[R] How to change the names in tone pitch column

2005-08-13 Thread Atte Tenkanen
Hi, I have a column (V4) in a midi event list which includes tone pitch names, i.e. A4, E4, C#4, A3...: compo[1:10,] V1 V2 V3 V4 V5 V6 V7 1 1 1 0 A4 96 2 0 2 1 1 0 E4 96 2 0 3 1 1 0 C#4 96 2 0 4 1 1 0 A3 96 2 0 5 1 3 0 B4 96 1 0 6 1 3 0 E4 96 1

Re: [R] How to change the names in tone pitch column

2005-08-13 Thread Atte Tenkanen
UC Berkeley [EMAIL PROTECTED] On Sat, 13 Aug 2005, Atte Tenkanen wrote: Hi, I have a column (V4) in a midi event list which includes tone pitch names, i.e. A4, E4, C#4, A3...: compo[1:10,] V1 V2 V3 V4 V5 V6 V7 1 1 1 0 A4 96 2

[R] From soundcard to R?

2004-10-24 Thread Atte Tenkanen
Is it possible to input data from sound card of the computer to R? What do I need to know about my computer (it's linux pc)? Can I get some real time graphical information this way, spektrum for example? Atte __ [EMAIL PROTECTED] mailing list