[R] Fractals with R
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 the page. Has somebody tried L-systems or Markov algorithm (http:// en.wikipedia.org/wiki/Markov_algorithm) with R? Best wishes, Atte Tenkanen University of Turku, Finland __ [EMAIL PROTECTED] 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, reproducible code.
[R] Genetic programming with R?
Hello everybody, I'm interesting in evolutionary algorithms. I have tested genetic algorithms with R but has someone tried with genetic programming? Do you know, if there are code somewhere written in R. Best wishes, 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-contained, reproducible code.
[R] The most common row in a matrix?
Hi, How do you get the most common row from a matrix? If I have a matrix like this array(1:3,dim=c(4,5)) [,1] [,2] [,3] [,4] [,5] [1,]12312 [2,]23123 [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 __ 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, reproducible code.
[R] Matrix from a vector?
Hi, Is there some function, which generates this kind of n x n -matrix from a vector? > rhset [1] 1792 256 13312 512 1024 2048 8192 4096 > m=matrix(nrow=length(rhset),ncol=length(rhset)) > for(i in 1:length(rhset)) + { + m[,i]=rhset + rhset=c(rhset[length(rhset)], rhset[2:length(rhset)-1]) + } > m [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1792 4096 8192 2048 1024 512 13312 256 [2,] 256 1792 4096 8192 2048 1024 512 13312 [3,] 13312 256 1792 4096 8192 2048 1024 512 [4,] 512 13312 256 1792 4096 8192 2048 1024 [5,] 1024 512 13312 256 1792 4096 8192 2048 [6,] 2048 1024 512 13312 256 1792 4096 8192 [7,] 8192 2048 1024 512 13312 256 1792 4096 [8,] 4096 8192 2048 1024 512 13312 256 1792 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-contained, reproducible code.
Re: [R] Weighted association map
Sorry to answer so late, but this is just what I want ;-) -Atte Gabor Grothendieck kirjoitti 8.9.2006 kello 14.53: > Actually the discretization does not appear to be needed. This > works just as well: > > set.seed(123) > kor <- cor(iris[1:4]) > gplot(sign(kor), edge.lwd = 10*kor, displaylabels = TRUE, label = > rownames(kor)) > > On 9/8/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: >> Try the sna package. Below we calculate the >> correlation matrix, kor, of the numeric cols of builtin iris >> dataset. Zap negative ones and discretize rest to >> get lwd width matrix, lwd, used for edge widths. From >> that create the adjacency matrix, sign(lwd), and plot it >> using indicated layout mode. Seems like three of >> the variables are correlated and Sepal.Width is uncorrelated >> or negatively correlated to those. Try playing around with >> gplot args to create variations. >> >> library(sna) >> set.seed(123) # layout uses random numbers >> kor <- cor(iris[1:4]) >> lwd <- replace(kor, TRUE, 10 * round(pmax(0, kor), 1)) >> gplot(sign(lwd), edge.lwd = lwd, displaylabels = TRUE, label = >> rownames(kor)) >> >> On 9/8/06, kone <[EMAIL PROTECTED]> wrote: >> > Could somebody program this kind of plot type to R, if none exists, >> > based on mds or correlation tables or some more suitable method? >> What >> > do you think about idea? Does it work? None similar or better >> exists? >> > >> > http://weightedassociationmap.blogspot.com/ >> > >> > >> > 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-contained, reproducible code. >> > >> __ 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, reproducible code.
Re: [R] Weighted association map
> Could somebody program this kind of plot type to R, if none exists, > based on mds or correlation tables or some more suitable method? > What do you think about idea? Does it work? None similar or better > exists? > > http://weightedassociationmap.blogspot.com/ > > > Atte Tenkanen > University of Turku, Finland I got a hint of package ade4 and function dudi.pca. Something like this, though I can't immediately interpret those dudi.pca-pictures. I originally saw this as a more general idea, which can, if wanted, be applied with statistical methods too. If you do multidimensional scaling, you can see, how "near" all components are each other, but you can't see the connections or directions. If you have a correlation matrix, you can't see the connections graphically. Atte __ 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, reproducible code.
[R] Weighted association map
Could somebody program this kind of plot type to R, if none exists, based on mds or correlation tables or some more suitable method? What do you think about idea? Does it work? None similar or better exists? http://weightedassociationmap.blogspot.com/ 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-contained, reproducible code.
[R] From two plot() to two X11-vindows?
Hi, Is it possible to update two X11-windows during the loops which include two plot() and perhaps lines()-commands? I have been given to understand that you can name the windows like this X11(display = "Device 5"); X11(display = "Device 6"); but how to send the information from different plot- and lines-commands to a certain window? Atte Tenkanen University of Turku, Finland [[alternative text/enriched version deleted]] __ 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, reproducible code.
[R] Successive subsets from a vector?
I'd like to pick every imbricated five character long subsets from a vector. I guess there is some efficient way to do this without loops... Here is a for-loop-version and a model for output: VECTOR=c(1,4,2,6,5,0,11,10,4,3,6,8,6); ADDRESSES=c(); 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 University of Turku, Finland [[alternative text/enriched version deleted]] __ 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, reproducible code.
[R] How to change the margin widths in png-plots?
Hello, I have tried to change the margin widths so that mtext (here "sd of consecutive pc intervals", look at the picture) and plot(...,xlab="bar") fits to the picture. Here is an example: http://users.utu.fi/attenka/margins.png This doesn't help: par(mar=c(5.1, 7.1, 4.1, 2.1)) And here are the commands: png(filename="/Users/kone/Vaitostutkimus/Pictures/ BachBWV60_sd_cons_pc_int.png", width = 2800, height = 1200,pointsize = 12, bg = "white"); plot(Compo_SD_succ_int_array_vector,ylim=c(0.40,1.9),col="white",xlab="b ar",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 next? Atte Tenkanen, Turku Finland [[alternative text/enriched version deleted]] __ 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