While I was trying to use get_yoga_name, I've observed that returned name contains 'NA'. So I have tried observing code execution using breakpoints to see what might be happening within get_yoga_name. Following are my observations
Sample 1
get_yoga_name(gregorian_to_jd(05,07,2023), c(16.99, 81.79, +5.5))
[1] "Vaidhriti till 7:47:38 & NA till 27:48:33"
I could see that in the for loop, during 2nd iteration variable j value is set to 5 resulting in accessing 5th element in the yoga_ array i.e. 28 in this example, which in turn produces 'NA' value due to out of bound access of yogas array.
I suspect there is an issue in yoga function which wrongly computed value 28 for 5th element in yoga_ array.
get_yoga_name <- function(jd,place){
yoga_ = yoga(jd,place)
size = length(yoga_)
size = size / 4
j <- 1
yoga_name <- ""
for(i in 1:size){
#* 'NA' caused by following line of code during 2nd iteration
yoga_name <- paste(yoga_name,yogas[yoga_[j]]," till",sep = "")
yoga_name <- paste(yoga_name,paste(yoga_[j+1], yoga_[j+2], yoga_[j+3], sep = ":"))
if(size > 1 && i == 1){
yoga_name <- paste(yoga_name,"& ")
}
j <- 5
}
return (yoga_name)
}
Thanks a lot for the amazing library.
While I was trying to use get_yoga_name, I've observed that returned name contains 'NA'. So I have tried observing code execution using breakpoints to see what might be happening within get_yoga_name. Following are my observations
Sample 1
Sample 2
I could see that in the for loop, during 2nd iteration variable j value is set to 5 resulting in accessing 5th element in the yoga_ array i.e. 28 in this example, which in turn produces 'NA' value due to out of bound access of yogas array.
I suspect there is an issue in yoga function which wrongly computed value 28 for 5th element in yoga_ array.