I am using scilab 5.5.2 version. How can I print a message in the console window of Scilab? What is the function used for that?
You can use either the disp or the mprintf functions. Example:
disp('Hello World')
Related
When I open a .R file and highlight a line and press Shift + Enter, VS code sends the line to R, but it mangles the text. For example, if I try to run
library(data.table)
Here is what I get back from R:
> 00~library(data.table)01~
Error: unexpected numeric constant in "00~library(data.table)01"
Strangest thing. VS Code works fine for me for Go, Typescript, Haskell, Python, but it doesn't like R. Any suggestions?
It looks like bracketed paste mode is on. Try adding this to your settings.json:
"r.bracketedPaste": false
Bracketed paste mode should usually be on if using the radian console but off if using the standard R console.
I'm using a non standard module in Julia, created by someone else.
Due to user restrictions I cannot modify this module.
The module prints the step it is currently executing to the console.
My console is full of excess information.
Question: Is there a way to suppress the console printing without modifying the module code?
To suppress the output of a function foo:
oldstd = stdout
redirect_stdout(devnull)
foo()
redirect_stdout(oldstd) # recover original stdout
If foo doesn’t have arguments one can also use redirect_stdout(foo, devnull)
However it works on my Linux box, but I am not 100% sure it works on Windows too..
I have a shiny application that I used to call the rmarkdonw::render() function. I want to be able to show the knitting progress using the withProgress() function like here: https://gallery.shinyapps.io/085-progress/
The problem is I don't know how to get the progress status from 'render()' function. Any ideas?
Is there a way to simulate Alt + Tab in R?
I've been looking for functions like SendInput, keybd_event, SendMessage and SendKeys.Send but couldn't find anything similar for R.
Some context:
I am using Rscript to plot and image that appears on the graphics device windows, then I call a function similar to readLines() and R waits for my input. The problem is that after the image pops up I have to go back to the terminal in order to give input and this makes my script less efficient.
I am using Ubuntu - Unity.
EDIT:
Is it possible to call bash from R? Maybe there is a function in bash that will make this possible?
If you are on windows, the following will work:
cls <- function () {
require(RDCOMClient)
wsh <- COMCreate("Wscript.Shell")
wsh$SendKeys("%{TAB}")
invisible(wsh)
}
cls()
Taken from here: http://r.789695.n4.nabble.com/clear-screen-td884932.html
More key presses can be found here: https://msdn.microsoft.com/en-us/library/8c6yea83(v=vs.84).aspx
Is it possible to change the behaviour of R console such that, for instance
before each command execution a fortune() is printed, or
similar to browser(), the prompt is altered, and some new commands (c,n,Q) are introduced?
I am looking for an alternative to readline() that keeps the history function (key up) intact.
I am using R on winxp with Rgui, but a portable solution would be great.
Yes, though it is independent of the GUI as just uses the callback mechanism as for example in the quesion on R: Display a time clock in the R command line.