Hello listeRs,

I'm trying to make a square radius around a given reference point. So given the following array, how can I manipulate it so that

x0 <- array(1,dim=c(5,5))
x0

1 1 1 1 1
1 1 1 1 1
1 1 *1* 1 1
1 1 1 1 1
1 1 1 1 1

becomes

into

3 3 3 3 3
3 2 2 2 3
3 2 *1* 2 3
3 2 2 2 3
3 3 3 3 3

Thanks.

Muhammad

______________________________________________
R-help@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.

Reply via email to