[R] Convert one rectangle into two rectangles

Ebert,Timothy Aaron
Tue, 26 Apr 2022 16:32:07 -0000

Yes it is possible, but contingent on exactly what you want to do and the form
of your data. Is this a picture with a rectangle, or is this a rectangular
matrix?

If there is one pixel per square meter then the matrix has dimensions 18 by 200.
45% of 200 is 90.
Mat <- matrix(0, nrow=18, ncol=200)
Mat1 <- Mat[,1:90]
Mat2 <- Mat[,91:200]


If this is a graphical question, my thought would be to try Python. You would
have to get Python to identify the rectangle and then give it some rules to
split the rectangle.

Tim

-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of javad bayat
Sent: Tuesday, April 26, 2022 5:21 AM
To: R-help at r-project.org
Subject: [R] Convert one rectangle into two rectangles

[External Email]

Dear R users;
I want to convert a rectangle into 2 new rectangles. I have a rectangle (18 m *
200 m), and I want to subtract 45 percent of it's area as a new rectangle.
Is it possible to do this in R?
Sincerely.

        [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=IT-iqd3VDNxH2pOQdJCv8la_J55nS5LrQMIs0gfoO4vYuZZXZdcV4UNweZVSctI6&s=2r0VJdEfq7-vH9GlxUtWS1235uMTfJyX2BUMRfTtmlk&ePLEASE
do read the posting guide
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=IT-iqd3VDNxH2pOQdJCv8la_J55nS5LrQMIs0gfoO4vYuZZXZdcV4UNweZVSctI6&s=pcSG7rjvhu775rq8Y8piGcqBjUz8fzP4m52PU17pUXg&eand
provide commented, minimal, self-contained, reproducible code.