7

I am using RStudio for my project, I want a separate screen for the output. I tried with sink(), but I need a new pop up window. My code is

vd<-data.frame()
vd<-c("V1","V2")
vf<-length(vd)
i<-1
while(i<=vf){
vd<-c("V1","V2")
#print(vd)
leng<-length(vd)
selectru<-combn(vd,leng)
#print(selectru)
print(selectru[i])
fst<-selectru[i]
select<-data.frame()
select<-selectru[selectru[,1]!=selectru[i],]
m<-length(select)
select<-combn(select,m)
snd <-apply(select,2,function(rows) paste0(rows, collapse = ""))
cat(sprintf("\"%s\" =>\"%s\"\n", fst,snd))
i<-i+1
}

These data is not the actual one, just example data.

Is it possible to show the output "ONLY" in a separate screen or browser window? no need to show any graph or plot operation.

nico
  • 50,859
  • 17
  • 87
  • 112
varun cyriac
  • 161
  • 1
  • 2
  • 10
  • There is an export button on top of the plot in RStudio if you want to send it to file or pdf. – crogg01 Jan 18 '14 at 11:07
  • okay,i think that export work for polting graph and image only ?. – varun cyriac Jan 18 '14 at 11:46
  • I don't know what you want this for, but you probably should have a look at knitr. – Roland Jan 18 '14 at 13:01
  • @Roland Actually I want a separate screen that contain my code output only. like sink() function ;get the output in notepad.Problem with sink() function is each time we need looking place it saved and open that notepad .is there any viewer screen for my code output in R studio or is it possible to show my output in browser ? – varun cyriac Jan 18 '14 at 14:20
  • tanks roland.knitr is good.but i think this not working for imported dataset instead of entering current data in console – varun cyriac Jan 18 '14 at 14:46
  • sorry it working for all dataset.thanks roland – varun cyriac Jan 18 '14 at 14:50
  • Take a look at the package **rite**. It will give you an output widget like what you're looking for. – Thomas Jan 18 '14 at 21:12

1 Answers1

6

Per my comment, here's an example using the sinkstart function from rite.

Code:

library(rite)
sinkstart(echo=FALSE)
# your code
# close the widget with the X or
# use `sinkstop()` to turn off the `sink`ing

Here's a screenshot:

enter image description here

Thomas
  • 43,637
  • 12
  • 109
  • 140
  • .this way i expect the ouput. – varun cyriac Jan 20 '14 at 12:48
  • 1
    .is it possible to find any output file after r code execution.(what i meant is like exe file created after C code execution ). – varun cyriac Jan 20 '14 at 12:52
  • I'm not sure I understand your question. This saves to two `tempfile()`'s in R's temporary session directory, so you could look for the files there. Otherwise, you have save the output manually with a `` on the keyboard or by accessing the right-click context menu on the widget. – Thomas Jan 20 '14 at 13:16
  • i think its not working.shall i asking this as another question in stack over flow.?. – varun cyriac Jan 20 '14 at 14:27
  • i am using Win 8.i saved ouput file.but nothing will happened after opening it.just one CMD is opened and show front end of R.I am a beginner in R.please explain it how to worked it? – varun cyriac Jan 21 '14 at 14:39
  • So you were able to save the output to a file, but then you couldn't open the file in a text editor? – Thomas Jan 21 '14 at 15:01
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/45724/discussion-between-user3090597-and-thomas) – varun cyriac Jan 21 '14 at 15:28
  • Works beautifully. From R-studio either from the console or from source, output is sent to a simple new window. Finally, I can see what I'm doing without moving panes up and down all day! Thank you Thomas! – BBW Before Windows Jun 28 '15 at 12:22
  • 1
    Package ‘rite’ was removed from the CRAN repository? What is the alternative? – Davor Josipovic Dec 18 '18 at 08:11