[R] Towards genetic programming...

2007-08-02 Thread Atte Tenkanen
ested 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.htm

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 ino

Re: [R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
3 [1] 7 Yours faithfully ;-) 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, Att

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 > >> &g

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

Re: [R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
LL > NULL > [1] 8 4 > [1] 8 4 > [1] 8 4 9 2 > [1] 8 4 9 2 > [1] 8 4 9 2 > [1] 8 4 9 2 10 5 > [1] 8 4 9 2 10 5 > [1] 8 4 9 2 10 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(u

[R] Break during the recursion?

2007-07-15 Thread Atte Tenkanen
9 2 10 5 [1] 8 4 9 2 10 5 [1] 8 4 9 2 10 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] 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 __

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

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 fo

[R] from character string to function body?

2007-07-07 Thread Atte Tenkanen
; > S [1] `-`(`+`(`^`(x,3),`^`(x,2)),1) # Here is the same as a character string. Now I'd like to create a function using this string, something like this, but of course, this doesn't work: S=as.expression(S) F1<-function(x){S} Is there some way to do this? Cheers, Atte Tenkane

[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 te

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

2007-05-09 Thread Atte Tenkanen
--- > > --- > > > > Ravi Varadhan, Ph.D. > > > > Assistant Professor, The Center on Aging and Health > > > > Division of Geriatric Medicine and Gerontology > > > > Johns Hopkins University > > > > Ph: (410) 502-2619 >

[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

[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 Universi

Re: [R] Fractals with R

2007-04-18 Thread Atte Tenkanen
our]) # This works! > > # But this doesn't! >a1=a1+1 >PointsMatrix[a1,]=c(x,y,colour) > } > } > > #??? > plot(PointsMatrix[,1], PointsMatrix[,2], xlim=Limits, ylim=Limits, > col=cl[PointsMatrix[,3]], pch=&q

Re: [R] Fractals with R

2007-04-18 Thread Atte Tenkanen
for(y in Step) { z1=x+y*1i n=0 z=z1 while(n Atte Tenkanen wrote: > > Hi, > > > > That is of counter for web page. Do you get some pop-up windows? > > > > > > Atte > > Hi Atte, >

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) > &g

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

2007-04-17 Thread Atte Tenkanen
version 2.4.1. 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, s

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 haven

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 > includ

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. &

[R] Scatterplot3d-proposal

2007-01-23 Thread Atte Tenkanen
option be added? 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.

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

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 com

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

[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 rea

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

[R] Hershey fonts for musical notation?

2007-01-03 Thread Atte Tenkanen
ine(h=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(

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

2006-11-19 Thread Atte Tenkanen
123 > > [3,]31231 > > [4,]12312 > > > > in which rows 1 and 4 are similar, I want to find that vector c > > (1,2,3,1,2). > > > > Atte Tenkanen > > University of Turku, Finland > > > > ___

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

2006-10-07 Thread Atte Tenkanen
astle.edu.au/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

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

2006-10-07 Thread Atte Tenkanen
uct here: > > http://tolstoy.newcastle.edu.au/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 s

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

2006-10-06 Thread Atte Tenkanen
> From: [EMAIL PROTECTED] > [mailto:[EMAIL 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 comparison

[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

[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
eturned in the case > that VECTOR has zero 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 t

Re: [R] Modifying the embed-results

2006-08-25 Thread Atte Tenkanen
6 8 So, there are no duplicates 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

[R] Modifying the embed-results

2006-08-25 Thread Atte Tenkanen
n advance! 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 and provide commented, minimal, self-contained, rep

Re: [R] Successive subsets from a vector?

2006-08-22 Thread Atte Tenkanen
RESSES=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

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] A matrix problem

2006-08-19 Thread Atte Tenkanen
RIX[,2][MATRIX[,1]==i])) RESULTMATRIX=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://st

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

2006-08-16 Thread Atte Tenkanen
> will get you what you want. > > Patrick Burns > [EMAIL PROTECTED] > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S User") > > Atte Tenkanen wrote: > > >Is there some (much) more efficient way to do

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

2006-08-16 Thread Atte Tenkanen
6 6 > NEWVECTOR [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/p

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? &

[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 PLEA

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

2006-06-19 Thread Atte Tenkanen
is=2); > mtext("sd of consecutive pc intervals", side=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? > >

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

2006-06-14 Thread Atte Tenkanen
uot;,ylab="", cex.lab=3, cex.axis=2); mtext("sd of consecutive pc intervals", side=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 nex

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

2006-03-24 Thread Atte Tenkanen
m=as.vector(m[,rev(order(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)

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 &

[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

[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 (g

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? > > At

[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

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

2005-08-13 Thread Atte Tenkanen
- Phil Spector >Statistical Computing Facility >Department of Statistics >UC Berkeley >[EMAIL PROTEC

[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

[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 https://s