dear members, I am running R on Linux AWS ec2 instance. When I try to create a histogram in it, I am running into problems:> xht <- c(1,2,3,4,5,6,7,8,9,10) > hist(xht) >when I type hist(xht), it goes to the next prompt. More importantly, there is no error message. So, the most probable conclusion is that the command gets executed. But there is no pop up screen with a histogram, and nothing else... whats going on? How can I circumvent the help of histogram(which is not available in GNU R)? summary(xht) would help, but not much. Any other function that can give information, in LINUX R, that a histogram gives, in LINUX CLI? Very many thanks for your time and effort... Yours sincerely, AKSHAYM KULKARNI [[alternative HTML version deleted]]
On Fri, 7 Sep 2018 08:26:22 +0000 akshay kulkarni <akshay_e4 at hotmail.com> wrote:> when I type hist(xht), it goes to the next prompt. More importantly, > there is no error message. So, the most probable conclusion is that > the command gets executedYes, hist() returns its value invisibly (try typing "? invisible" in the R prompt without the quotes), which means that you don't see it, but you can assign it to a variable and then view as usual:> xht <- c(1,2,3,4,5,6,7,8,9,10) > hxt <- hist(xht) > hxtYou can also use the following trick:> (hist(xht))to see the invisible returned value without assigning it to a temporary variable.> But there is no pop up screen with a histogram, and nothing else...As to why you cannot see a plot, it depends a lot on your setup. For example, how exactly do you connect to the R instance running at AWS? If you use plain SSH from your own Linux machine, try `ssh -X` to allow the remote server to connect to the X graphics system on your machine and display windows (alas, it gets very slow). What does `dev.cur()` show after you run `hist(xht)`? On my machine, when I start R with no available X connection, it automatically switches to the non-interactive `pdf` graphics device; all plots get redirected to the `Rplots.pdf` file in the current directory. Perhaps you can download that file from the EC2 instance and view it locally? -- Best regards, Ivan
You are most likely plotting to a non-screen device. Check dev.list() after the hist(), and then the documentation for that device. It's probably pdf, and after quitting R, you should find that a file Rplots.pdf has been created. -pd> On 7 Sep 2018, at 10:26 , akshay kulkarni <akshay_e4 at hotmail.com> wrote: > > dear members, > I am running R on Linux AWS ec2 instance. > When I try to create a histogram in it, I am running into problems: > >> xht <- c(1,2,3,4,5,6,7,8,9,10) >> hist(xht) >> > > when I type hist(xht), it goes to the next prompt. More importantly, there is no error message. So, the most probable conclusion is that the command gets executed. But there is no pop up screen with a histogram, and nothing else... > > whats going on? > > How can I circumvent the help of histogram(which is not available in GNU R)? summary(xht) would help, but not much. Any other function that can give information, in LINUX R, that a histogram gives, in LINUX CLI? > > Very many thanks for your time and effort... > Yours sincerely, > AKSHAYM KULKARNI > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
You may have to install X11 stuff to your ec2 instance. E.g., googling for "ec2 X11 forwarding" showed things like the following: Re: X11 forwarding to access AWS EC2 Linux instance Posted by: wilderfield <https://forums.aws.amazon.com/profile.jspa?userID=433982> Posted on: Apr 5, 2018 11:31 AM [image: in response to: LE M.] <https://forums.aws.amazon.com/message.jspa?messageID=574740#574740> in response to: LE M. <https://forums.aws.amazon.com/message.jspa?messageID=574740#574740> [image: Click to reply to this thread] <https://forums.aws.amazon.com/post!reply.jspa?messageID=841377> Reply <https://forums.aws.amazon.com/post!reply.jspa?messageID=841377> x11 <https://forums.aws.amazon.com/tags/x11> sudo yum install xorg-x11-xauth The above is all I needed to get X11 forwarding working over ssh When ssh-ing to the instance, use the -X flag Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Sep 7, 2018 at 1:26 AM, akshay kulkarni <akshay_e4 at hotmail.com> wrote:> dear members, > I am running R on Linux AWS ec2 instance. > When I try to create a histogram in it, I am running into problems: > > > xht <- c(1,2,3,4,5,6,7,8,9,10) > > hist(xht) > > > > when I type hist(xht), it goes to the next prompt. More importantly, there > is no error message. So, the most probable conclusion is that the command > gets executed. But there is no pop up screen with a histogram, and nothing > else... > > whats going on? > > How can I circumvent the help of histogram(which is not available in GNU > R)? summary(xht) would help, but not much. Any other function that can give > information, in LINUX R, that a histogram gives, in LINUX CLI? > > Very many thanks for your time and effort... > Yours sincerely, > AKSHAYM KULKARNI > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
A simpler short term solution is to execute dev.off() and look for the plot in file Rplots.pdf in the current directory. Depending on the OS of the local computer, you should be able to point a file browser at the EC instance and simply click the file to open in in a pdf viewer on the local machine. Peter On Fri, Sep 7, 2018 at 10:31 AM William Dunlap via R-help < r-help at r-project.org> wrote:> You may have to install X11 stuff to your ec2 instance. E.g., googling for > "ec2 X11 forwarding" showed things like the following: > > Re: X11 forwarding to access AWS EC2 Linux instance > Posted by: wilderfield > <https://forums.aws.amazon.com/profile.jspa?userID=433982> > Posted on: Apr 5, 2018 11:31 AM > [image: in response to: LE M.] > <https://forums.aws.amazon.com/message.jspa?messageID=574740#574740> in > response to: LE M. > <https://forums.aws.amazon.com/message.jspa?messageID=574740#574740> > [image: Click to reply to this thread] > <https://forums.aws.amazon.com/post!reply.jspa?messageID=841377> Reply > <https://forums.aws.amazon.com/post!reply.jspa?messageID=841377> > x11 <https://forums.aws.amazon.com/tags/x11> > sudo yum install xorg-x11-xauth > > The above is all I needed to get X11 forwarding working over ssh > > When ssh-ing to the instance, use the -X flag > > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Fri, Sep 7, 2018 at 1:26 AM, akshay kulkarni <akshay_e4 at hotmail.com> > wrote: > > > dear members, > > I am running R on Linux AWS ec2 instance. > > When I try to create a histogram in it, I am running into problems: > > > > > xht <- c(1,2,3,4,5,6,7,8,9,10) > > > hist(xht) > > > > > > > when I type hist(xht), it goes to the next prompt. More importantly, > there > > is no error message. So, the most probable conclusion is that the command > > gets executed. But there is no pop up screen with a histogram, and > nothing > > else... > > > > whats going on? > > > > How can I circumvent the help of histogram(which is not available in GNU > > R)? summary(xht) would help, but not much. Any other function that can > give > > information, in LINUX R, that a histogram gives, in LINUX CLI? > > > > Very many thanks for your time and effort... > > Yours sincerely, > > AKSHAYM KULKARNI > > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide http://www.R-project.org/ > > posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]