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

  • SEARCH
  • Home
  • 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 9167565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:25:19+00:00 2026-06-17T15:25:19+00:00

DataLink: https://www.dropbox.com/s/rvwq3uw0p14g9c6/GTAP_Macro.csv Code: ccmacrosims <- read.csv(file = F:/Purdue University/RA_Position/PhD_ResearchandDissert/PhD_Draft/GTAP-CGE/GTAP_NewAggDatabase/NewFiles/GTAP_Macro.csv, header=TRUE, sep=,, na.string=NA, dec=., strip.white=TRUE)

  • 0

DataLink:
https://www.dropbox.com/s/rvwq3uw0p14g9c6/GTAP_Macro.csv

Code:

     ccmacrosims <- read.csv(file = "F:/Purdue University/RA_Position/PhD_ResearchandDissert/PhD_Draft/GTAP-CGE/GTAP_NewAggDatabase/NewFiles/GTAP_Macro.csv", header=TRUE, sep=",", na.string="NA", dec=".", strip.white=TRUE)

     ccmacrorsts <- as.data.frame(ccmacrosims)
     ccmacrorsts[6:10] <- sapply(ccmacrorsts[6:10],as.numeric)
     ccmacrorsts <- droplevels(ccmacrorsts)
     ccmacrorsts <- transform(ccmacrorsts,region=factor(region,levels=unique(region)))

     library(ggplot2)
     #Data manipulations to select variables of interest within the dataframe
     GDPtradlib1 <- melt(ccmacrorsts[ccmacrorsts$region %in% c("EAsia","USA","OecdEU","XMidEast","FrmUSSR","EastEU","TUR","MAR"), ])
     GDPtradlib2 <- GDPtradlib1[GDPtradlib1$sres %in% c("AVERAGE"), ]
     GDPtradlib.f <- GDPtradlib2[GDPtradlib2$variable %in% c("GDP"), ] 
     GDPtradlib.f <- subset(GDPtradlib.f, tradlib != "BASEDATA")

     GDPtradlib.f[1:20,]

     #Plotting
     plot <- ggplot(data = GDPtradlib.f, aes(x=factor(tradlib), y=value) + 
     plot + geom_bar(stat="identity") + facet_wrap(~region, scales="free_y") 

Question: I am trying to plot the variable GDP (y_axis) by tradlib scenario (x_axis) for each region and using facet_wrap() to produce multiple barplots.

R-message error:

+ plot <- ggplot(data = GDPtradlib.f, aes(x=factor(tradlib), y=value) + 
Error: unexpected symbol in:
"plot + geom_bar(stat="identity") + facet_wrap(~region, scales="free_y")
plot"
> plot + geom_bar(stat="identity") + facet_wrap(~region, scales="free_y")
Error in plot + geom_bar(stat = "identity") : 
  non-numeric argument to binary operator
  • 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-06-17T15:25:20+00:00Added an answer on June 17, 2026 at 3:25 pm

    You are missing a ) after y=value).

    Apart from that your code works, it produced the image below:enter image description here

    The only difference from your code and the code I ran is, I used the gdata library to drop the levels.

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

Sidebar

Related Questions

http://jvalentino2.tripod.com/dft/index.html My code is really just a copy of the above: package it.vigtig.realtime.fourier; import
URL url = new URL(http://www.dasolorfire.freehostia.com/sound/test.wav); AudioInputStream sound = AudioSystem.getAudioInputStream(url); //Sound.java:50 DataLine.Info info = new
This is a slightly modified example from the Java Sound info page. https://stackoverflow.com/tags/javasound/info Unfortunately,
How do I return the comment property from exif_read_data link: http://www.php.net/manual/en/function.exif-read-data.php
I am trying to use the zClip jQuery plugin (http://www.steamdev.com/zclip/#features) and am wanting to
I have a need to set radio buttons using the setField() method from datalink
I am trying to save the output of this file in libpcap format and
I'm writing some JDBC code which calls a Oracle 11g PL/SQL procdedure which has
I am using File Helpers and I am unsure how to take my data
$.get('example.com',function(data){ link = $(data #someid).attr(href) // how to do this??? }) I load a

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.