[R] Asking Favor

Michael Bedward michael.bedward at gmail.com
Thu Sep 16 06:08:20 CEST 2010


Hello Chuan,

If you just want a matrix with the numbers 1 to 64 arranged by row...

m <- matrix(1:64, ncol=8, byrow=TRUE)

But perhaps I don't understand your question properly ?

Michael


On 16 September 2010 12:46, chuan zun liang <chuan_zl at yahoo.com.my> wrote:
> Dear Prof:
>
> My name is Chuan.I from Malaysia.I am a beginner for R.I need favor for Prof.
>
> This is my data:
> y<-c(52,55,61,66,70,61,64,73,63,59,55,90,109,85,69,72,62,59,68,113,144,104,66,73,63,58,71,122,154,106,70,69,67,61,68,104,126,88,68,70,79,65,60,70,77,68,58,75,85,71,64,59,55,61,65,83,87,79,69,68,65,76,78,94)
>
>
> and I form it into matrix as below:     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
> [1,]   52   63     62    63    67   79   85   87
> [2,]   55   59     59    58    61   65   71   79
> [3,]   61   55     68    71    68   60   64   69
> [4,]   66   90   113  122  104   70   59   68
> [5,]   70  109  144  154  126   77   55   65
> [6,]   61   85   104  106    88   68   61   76
> [7,]   64   69     66    70    68   58   65   78
>
> [8,]   73   72     73    69    70   75   83   94
>
> But i want replace 52 by 1, 63 by 2, 63 by 5, ........94 by 64. Is it possible I
> do it in R.Thank a lot.
>
> Chuan
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
>



More information about the R-help mailing list