Re: [R] Indexing a loop-created list
__ 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] Indexing a loop-created list
hi, try this: my_list - NULL for (i in 1:n) {for (j in (i+1):m) {my_list - c(my_list,list(i_create_a_matrix(i,j))) } } Best, Romain Romain Lorrillière UMR 8079 Laboratoire Ecologie, Systématique et Evolution Bât. 362 Université Paris-Sud 91405 Orsay cedex France tel : 01 69 15 56 85 fax : 01 69 15 56 96 mobile : 06 81 70 90 70 email : [EMAIL PROTECTED] Nicolas Prune a écrit : Hello, I create a certain number (n*m) matrices, that I would like to store. These matrices have different dimensions. As far as I know, for matrices of different dimensions, there's no alternative to a list. Here's how I store them on the fly : my_list - NULL for (i in 1:n) {for (j in (i+1):m) {my_list - list(my_list,i_create_a_matrix(i,j))) } } But the indexation of the result is horrible ! (see below a simplified version, with no matrices created but i*10+j added to the list instead). Is there a cleaner way to get the same result ? Any help will be very welcomed. Nicolas [[1]] [[1]][[1]] [[1]][[1]][[1]] [[1]][[1]][[1]][[1]] [[1]][[1]][[1]][[1]][[1]] [[1]][[1]][[1]][[1]][[1]][[1]] NULL [[1]][[1]][[1]][[1]][[1]][[2]] [1] 12 [[1]][[1]][[1]][[1]][[2]] [1] 13 [[1]][[1]][[1]][[2]] [1] 14 [[1]][[1]][[2]] [1] 23 [[1]][[2]] [1] 24 [[2]] [1] 34 __ 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] new R-user needs help
try this, if your data frame name is tab mean.tab = data.frame (meanA = mean(tab[tab$name == 'a' ,4:8]), meanB = mean(tab[tab$name == 'b',4:8]), meanC = mean(tab[tab$name == 'c',4:8])) mean.tab good luck Romain Romain Lorrillière UMR 8079 Laboratoire Ecologie, Systématique et Evolution Bât. 362 Université Paris-Sud 91405 Orsay cedex France tel : 01 69 15 56 85 fax : 01 69 15 56 96 mobile : 06 81 70 90 70 email : [EMAIL PROTECTED] [EMAIL PROTECTED] a écrit : Dear all, I have a dataset Exp name id x1 x2 x3 x4 x5 1 a1 23 24 23 22 30 1 b2 25 26 27 23 24 1 c3 32 19 23 25 28 2 a4 28 32 24 26 27 2 b5 23 24 25 26 28 2 c6 23 31 30 38 23 3 a7 24 25 31 27 29 3 b8 28 25 26 32 28 3 c9 21 31 28 23 29 where each name a,b and c is repeated three times. Now I want to calculate the the averages of a,b and c over the three experiments for each x. For example for x1 I want to calculate the average of a like [a(from exp1) + a(exp2)+ a(exp3)]/3= (23+28+24)/3 How can I do that ? Thanks for your help, Regards, Antonia __ [EMAIL PROTECTED] mailing list [3]https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide [4]http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. References 1. mailto:[EMAIL PROTECTED] 2. mailto:R-help@stat.math.ethz.ch 3. https://stat.ethz.ch/mailman/listinfo/r-help 4. http://www.R-project.org/posting-guide.html __ 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] converting decimal - hexadecimal
Hi, do you know, a method to convert an decimal value (integer) to the corresponding hexadecimal value ? thinks for help. Romain -- Lorrillière Romain UMR 8079 Laboratoire Ecologie, Systématique et Evolution Bât. 362 Université Paris-Sud 91405 Orsay cedex France tel : 01 69 15 56 85 fax : 01 69 15 56 96 mobile : 06 81 70 90 70 email : [EMAIL PROTECTED] __ 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 -- Romain Lorrillière UMR 8079 Laboratoire Ecologie, Systématique et Evolution Bât. 362 Université Paris-Sud 91405 Orsay cedex France tel : 01 69 15 56 85 fax : 01 69 15 56 96 mobile : 06 81 70 90 70 email : [EMAIL PROTECTED] __ 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] executable file with R
Hi, I made an R function, and I want make an executable applet with it. Do you know how it is possible? Thank for your help. Romain -- Lorrillière Romain UMR 8079 Laboratoire Ecologie, Systématique et Evolution Bât. 362 Université Paris-Sud 91405 Orsay cedex France tel : 01 69 15 56 85 fax : 01 69 15 56 96 mobile : 06 81 70 90 70 email : [EMAIL PROTECTED] __ 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] converting hexadecimal
Hi, do you know, a method to convert an hexadecimal value to the corresponding integer value (decimal) ? thinks for help. Romain -- Lorrillière Romain UMR 8079 Laboratoire Ecologie, Systématique et Evolution Bât. 362 Université Paris-Sud 91405 Orsay cedex France tel : 01 69 15 56 85 fax : 01 69 15 56 96 mobile : 06 81 70 90 70 email : [EMAIL PROTECTED] __ 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