Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6202339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:42:58+00:00 2026-05-24T04:42:58+00:00

I am using the following code to draw a graph and print it to

  • 0

I am using the following code to draw a graph and print it to a PDF:

ggplot(agg_data_cl, aes( as.Date(date), avg_entries, color = classification ) ) +
  geom_point()

ggsave(file = "output.pdf")

This works fine when I execute the script in TextMate.

But when I call it from the commandline via RScript I get the following error:

Error in all.vars(as.formula(.$facets)) : 
  could not find function "as.formula"
Calls: print ... <Anonymous> -> <Anonymous> -> <Anonymous> -> all.vars
Execution halted

I use the following header in my RScrpipt file:

#! /usr/local/bin/Rscript --vanilla --default-packages=utils

Any ideas what could be the problem?

Here is my command line session information:

R version 2.13.1 (2011-07-08)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] C/UTF-8/C/C/C/C

attached base packages:
[1] grid  utils base 

other attached packages:
[1] ggplot2_0.8.9 proto_0.3-9.2 reshape_0.8.4 plyr_1.5.2   

loaded via a namespace (and not attached):
[1] grDevices_2.13.1 graphics_2.13.1  stats_2.13.1

In textmate sessionInfo() gives me more attached base packages:

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods  
[8] base

I have no idea why this the case.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:43:00+00:00Added an answer on May 24, 2026 at 4:43 am

    as.formula is in the stats package. Not sure why it isn’t being loaded, but see if manually including library(stats) at the start of your script fixes the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to draw a green line at some specified coordinates
I'm using the following code to draw an SVG text box, and then change
I can draw a hyperlinked shape in tikz using the following code: \documentclass{article} \usepackage{tikz}
I want to draw some sort graphics on winform using following code : private
I am using the following code to draw Strings. In GDI+ Graphics tempFontGr(XXX); Matrix*
I'm using the following code to draw plots of two different data on same
I am using the following code to override and draw each list item within
I've built a graph using the following code: G = networkx.Graph() G.add_edges_from([list(e) for e
I am using following code to draw scaled image in PaintListener. e.gc.drawImage(image, 0, 0,
I am using the following code to draw text onto a jpg image but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.