Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rio ggplot2 not giving expected results #16

Closed
mpettis opened this issue Oct 10, 2014 · 8 comments
Closed

Rio ggplot2 not giving expected results #16

mpettis opened this issue Oct 10, 2014 · 8 comments

Comments

@mpettis
Copy link
Contributor

mpettis commented Oct 10, 2014

Working from book, on reproducing Fig 7-4 in the book, I run this from the ch07 directory:

$ <data/tips.csv Rio -ge 'g+geom_bar(aes(factor(size)))'
ARGUMENT '',~+~file='/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-zQ6olMgv.png')}else~+~if(exists('is.ggplot')&&is.ggplot(last)){ggsave('/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-zQ6olMgv.png',last,dpi=72,units='cm',width=20,height=15);}else{sink('/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-zQ6olMgv.png');print(last);}' __ignored__

Loading required package: ggplot2
Loading required package: methods

I would expect that binary would stream to stdout that I could pipe to display or a .png file, but I get only this. Also, If I run the following, I get the results below:

$ <data/tips.csv Rio -e 'head(df)'
ARGUMENT '',~+~file='/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-xGYRL7dR.png')}else~+~if(exists('is.ggplot')&&is.ggplot(last)){ggsave('/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-xGYRL7dR.png',last,dpi=72,units='cm',width=20,height=15);}else{sink('/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-xGYRL7dR.png');print(last);}' __ignored__

   bill  tip    sex smoker day   time size
1 16.99 1.01 Female     No Sun Dinner    2
2 10.34 1.66   Male     No Sun Dinner    3
3 21.01 3.50   Male     No Sun Dinner    3
4 23.68 3.31   Male     No Sun Dinner    2
5 24.59 3.61 Female     No Sun Dinner    4
6 25.29 4.71   Male     No Sun Dinner    4

What I'm not expecting is the line starting with ARGUMENT .... Could not figure out what is wrong. Any ideas?

@jeroenjanssens
Copy link
Owner

Thanks. Two questions:

  • Are you running this inside the Data Science Toolbox?
  • What's the output when you also specify the -v option (for verbose)?

@mpettis
Copy link
Contributor Author

mpettis commented Oct 10, 2014

The VM? no, not yet. But I do want to make these tools work on my laptop for my own purposes.

Second, here is the -v output:

$ <data/tips.csv Rio -vge 'g+geom_bar(aes(factor(size)))'
ARGUMENT '',~+~file='/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-lsJSNNvK.png')}else~+~if(exists('is.ggplot')&&is.ggplot(last)){ggsave('/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-lsJSNNvK.png',last,dpi=72,units='cm',width=20,height=15);}else{sink('/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-lsJSNNvK.png');print(last);}' __ignored__

Loading required package: ggplot2
Loading required package: methods
cat: /var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/Rio-cJIuYzF7.err: No such file or directory

And that is the location of my $TMPDIR:

$ echo $TMPDIR
/var/folders/4s/gd5gw2bd2n16njbfqsg0j5yc0000gn/T/

So I'm not sure what the file or directory that is missing is.

@jeroenjanssens
Copy link
Owner

Understandable, but I haven't tested these tools on anything other than GNU/Linux. Are you on Mac OS X by any chance?

@mpettis
Copy link
Contributor Author

mpettis commented Oct 10, 2014

Yes I am, I should have stated that. I'll try and root out a solution as
well.

@mpettis
Copy link
Contributor Author

mpettis commented Oct 13, 2014

So, I created this pull request that solved my problem on Mac, I think it should be compatible with Linux as well, but will leave for you now to see if it works in your stack. Also solved second problem in that pull, which I think you probably had in Linux as well, where you created some extra files with the mktemp call inadvertently, and they probably were not getting cleaned up.

Original pull request #17 had error, I closed that, opened new one below.

FIxed pull request: #18

@jeroenjanssens
Copy link
Owner

Fixed now.

@mpettis
Copy link
Contributor Author

mpettis commented Nov 14, 2014

Thank you!

1 similar comment
@vielmetti
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants