Trasp function
Rapsodia86 opened this issue · 2 comments
Rapsodia86 commented
Hi there,
I think that there is missing parenthesis in the equation.
ORG:
"trasp <- function(x, ...) {
if (!inherits(x, "RasterLayer")) stop("MUST BE RasterLayer OBJECT")
asp <- raster::terrain(x, out='aspect', unit='degrees')
return( raster::calc(asp, fun=function(x) { 1 - cos( (3.142/180) *(x - 30) ) / 2 }, ... ) )"
Should not be?:
"trasp <- function(x, ...) {
if (!inherits(x, "RasterLayer")) stop("MUST BE RasterLayer OBJECT")
asp <- raster::terrain(x, out='aspect', unit='degrees')
return( raster::calc(asp, fun=function(x) { (1 - cos( (3.142/180) *(x - 30) )) / 2 }, ... ) )"
Best,
Monika
jeffreyevans commented
Monika,
Yep, that in fact was a mistake. Thank you for catching it! Is now fixed and will be a reported bug fix in the next CRAN release.
Best,
Jeff
From: Rapsodia86 <notifications@github.com>
Sent: Sunday, September 29, 2019 7:54 PM
To: jeffreyevans/spatialEco <spatialEco@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [jeffreyevans/spatialEco] Trasp function (#18)
Hi there,
I think that there is missing parenthesis in the equation.
ORG:
"trasp <- function(x, ...) {
if (!inherits(x, "RasterLayer")) stop("MUST BE RasterLayer OBJECT")
asp <- raster::terrain(x, out='aspect', unit='degrees')
return( raster::calc(asp, fun=function(x) { 1 - cos( (3.142/180) *(x - 30) ) / 2 }, ... ) )"
Should not be?:
"trasp <- function(x, ...) {
if (!inherits(x, "RasterLayer")) stop("MUST BE RasterLayer OBJECT")
asp <- raster::terrain(x, out='aspect', unit='degrees')
return( raster::calc(asp, fun=function(x) { (1 - cos( (3.142/180) *(x - 30) )) / 2 }, ... ) )"
Best,
Monika
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#18?email_source=notifications&email_token=ACLKH73OJPJIADA2Y7CHDU3QMFL3BA5CNFSM4I3VBVS2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HONRJWQ>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACLKH76B7ZB2NTEOVUYMDSTQMFL3BANCNFSM4I3VBVSQ>.
Rapsodia86 commented
Happy to help☺
Best regards,
Monika
Monika Anna Tomaszewska, M.S.
Ph.D. Candidate, Research Assistant
Geospatial Sciences Center of Excellence
Wecota Hall 115, Box 0506B
Brookings, SD 57007
www.sdstate.edu<http://www.sdstate.edu/>
[cid:image001.png@01D341BC.98DBE000]
[cid:image002.png@01D341BC.98DBE000]<https://www.facebook.com/SouthDakotaStateUniversity?fref=ts> [cid:image003.png@01D341BC.98DBE000] <https://twitter.com/SDState> [cid:image004.png@01D341BC.98DBE000] <https://www.youtube.com/user/SouthDakotaState> [cid:image005.png@01D341BC.98DBE000] <http://instagram.com/sdstatepics>
From: Jeffrey S. Evans <notifications@github.com>
Sent: Monday, September 30, 2019 10:16 AM
To: jeffreyevans/spatialEco <spatialEco@noreply.github.com>
Cc: Tomaszewska, Monika <monika.tomaszewska@sdstate.edu>; Author <author@noreply.github.com>
Subject: Re: [jeffreyevans/spatialEco] Trasp function (#18)
Monika,
Yep, that in fact was a mistake. Thank you for catching it! Is now fixed and will be a reported bug fix in the next CRAN release.
Best,
Jeff
From: Rapsodia86 <notifications@github.com<mailto:notifications@github.com>>
Sent: Sunday, September 29, 2019 7:54 PM
To: jeffreyevans/spatialEco <spatialEco@noreply.github.com<mailto:spatialEco@noreply.github.com>>
Cc: Subscribed <subscribed@noreply.github.com<mailto:subscribed@noreply.github.com>>
Subject: [jeffreyevans/spatialEco] Trasp function (#18)
Hi there,
I think that there is missing parenthesis in the equation.
ORG:
"trasp <- function(x, ...) {
if (!inherits(x, "RasterLayer")) stop("MUST BE RasterLayer OBJECT")
asp <- raster::terrain(x, out='aspect', unit='degrees')
return( raster::calc(asp, fun=function(x) { 1 - cos( (3.142/180) *(x - 30) ) / 2 }, ... ) )"
Should not be?:
"trasp <- function(x, ...) {
if (!inherits(x, "RasterLayer")) stop("MUST BE RasterLayer OBJECT")
asp <- raster::terrain(x, out='aspect', unit='degrees')
return( raster::calc(asp, fun=function(x) { (1 - cos( (3.142/180) *(x - 30) )) / 2 }, ... ) )"
Best,
Monika
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#18?email_source=notifications&email_token=ACLKH73OJPJIADA2Y7CHDU3QMFL3BA5CNFSM4I3VBVS2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HONRJWQ>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ACLKH76B7ZB2NTEOVUYMDSTQMFL3BANCNFSM4I3VBVSQ>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#18?email_source=notifications&email_token=ANK7QZYKI6ROTAHWRN77UH3QMIJ2TA5CNFSM4I3VBVS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD76AH3A#issuecomment-536609772>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ANK7QZ6MOTZKUV45JY2FZKTQMIJ2TANCNFSM4I3VBVSQ>.