BARIS icon indicating copy to clipboard operation
BARIS copied to clipboard

Little improvement

Open paul-carteron opened this issue 2 years ago • 2 comments

Hello @feddelegrand7 , First of all, bravo for this beautiful and surely useful work !! I already tried it a bit and it works perfectly !

I notice that BARIS_explain() return a raw character so you have some : "\n" or "l&#x27". Special character are not read.

An easy way of enhancing it for a better reading is to use cat function here like that :

return(cat(df_explain$description))

Have a good day ;)

PS : If you're interested I'm doing quite the same work with IGN data in the happign package

paul-carteron avatar Apr 14 '22 07:04 paul-carteron

thanks @paul-carteron I'll have a look at Baris_explain, the problem with cat is that you cannot assign the result of it to a variable, i.e, this is not possible: x <- cat("hello"). The happign package looks neat, thanks!

feddelegrand7 avatar Apr 16 '22 06:04 feddelegrand7

Yes, you're right. To have both advantages I aready done something like that :

foo <- function(text, silent = FALSE){
   if (!silent){
        cat(text)
   } 
   return(text)
}

So in both case you assign the text, and you can choose if you wanna display it.

paul-carteron avatar Apr 16 '22 11:04 paul-carteron