gathering all available data for a year in “oec” library for RHow to join (merge) data frames (inner, outer, left, right)?Tricks to manage the available memory in an R sessionDrop data frame columns by nameWhat is the difference between require() and library()?Merging country-year data into directed dyad-year data in RAggregate by specific year in RR - Keep newest data that is not NA, unless only NA availableData management: use long format to multiply and divide columnsMapping a dataframe (with NA) to an n by n adjacency matrix (as a data.frame object)Eigenvector values for different time periods of same network (igraph in R)

HashMap containsKey() returns false although hashCode() and equals() are true

Hide Select Output from T-SQL

Implement the Thanos sorting algorithm

Your magic is very sketchy

Failed to fetch jessie backports repository

MaTeX, font size, and PlotLegends

Is it okay / does it make sense for another player to join a running game of Munchkin?

The baby cries all morning

Why does John Bercow say “unlock” after reading out the results of a vote?

How to be diplomatic in refusing to write code that breaches the privacy of our users

At which point does a character regain all their Hit Dice?

The Riley Riddle Mine

What's a natural way to say that someone works somewhere (for a job)?

Print name if parameter passed to function

Opposite of a diet

How will losing mobility of one hand affect my career as a programmer?

Is a roofing delivery truck likely to crack my driveway slab?

Teaching indefinite integrals that require special-casing

Is there an Impartial Brexit Deal comparison site?

quarter to five p.m

Greatest common substring

How can I use the arrow sign in my bash prompt?

How to avoid InDesign adding pages automatically?

Star/Wye electrical connection math symbol



gathering all available data for a year in “oec” library for R


How to join (merge) data frames (inner, outer, left, right)?Tricks to manage the available memory in an R sessionDrop data frame columns by nameWhat is the difference between require() and library()?Merging country-year data into directed dyad-year data in RAggregate by specific year in RR - Keep newest data that is not NA, unless only NA availableData management: use long format to multiply and divide columnsMapping a dataframe (with NA) to an n by n adjacency matrix (as a data.frame object)Eigenvector values for different time periods of same network (igraph in R)













0















I am trying to gather all available data on bilateral trade in a specific using "oec" library for R, but the function "getdata" will only return data for a specific country pair. I want to get all data on bilateral for a specific year (data on all country pairs). I tried writing a loop so I could get what I wanted, but it takes R too long to finish it. This is the code I used:



x = 1
y = 1
library(oec)
countries <- country_codes()

while(x < 264)
if(x == y)
y = y + 1

else
try(table<- rbind(getdata(countries[get("x"),1], countries[get("y"),1], year = 2014)))
y = y + 1
if(y >= 264)
a = a + 1
x = x + 1
y = 1










share|improve this question







New contributor




Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • "OEC" stands for "Observatory of Economic Complexity"

    – Pedro Ferreira
    Mar 21 at 15:23











  • Could you show a sample of the data with dput and what you expect as your result?. Maybe a different package or solution exists?

    – NelsonGon
    Mar 21 at 15:41












  • There are 263 countries listed, that's why I put 264

    – Pedro Ferreira
    Mar 21 at 19:47















0















I am trying to gather all available data on bilateral trade in a specific using "oec" library for R, but the function "getdata" will only return data for a specific country pair. I want to get all data on bilateral for a specific year (data on all country pairs). I tried writing a loop so I could get what I wanted, but it takes R too long to finish it. This is the code I used:



x = 1
y = 1
library(oec)
countries <- country_codes()

while(x < 264)
if(x == y)
y = y + 1

else
try(table<- rbind(getdata(countries[get("x"),1], countries[get("y"),1], year = 2014)))
y = y + 1
if(y >= 264)
a = a + 1
x = x + 1
y = 1










share|improve this question







New contributor




Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • "OEC" stands for "Observatory of Economic Complexity"

    – Pedro Ferreira
    Mar 21 at 15:23











  • Could you show a sample of the data with dput and what you expect as your result?. Maybe a different package or solution exists?

    – NelsonGon
    Mar 21 at 15:41












  • There are 263 countries listed, that's why I put 264

    – Pedro Ferreira
    Mar 21 at 19:47













0












0








0








I am trying to gather all available data on bilateral trade in a specific using "oec" library for R, but the function "getdata" will only return data for a specific country pair. I want to get all data on bilateral for a specific year (data on all country pairs). I tried writing a loop so I could get what I wanted, but it takes R too long to finish it. This is the code I used:



x = 1
y = 1
library(oec)
countries <- country_codes()

while(x < 264)
if(x == y)
y = y + 1

else
try(table<- rbind(getdata(countries[get("x"),1], countries[get("y"),1], year = 2014)))
y = y + 1
if(y >= 264)
a = a + 1
x = x + 1
y = 1










share|improve this question







New contributor




Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am trying to gather all available data on bilateral trade in a specific using "oec" library for R, but the function "getdata" will only return data for a specific country pair. I want to get all data on bilateral for a specific year (data on all country pairs). I tried writing a loop so I could get what I wanted, but it takes R too long to finish it. This is the code I used:



x = 1
y = 1
library(oec)
countries <- country_codes()

while(x < 264)
if(x == y)
y = y + 1

else
try(table<- rbind(getdata(countries[get("x"),1], countries[get("y"),1], year = 2014)))
y = y + 1
if(y >= 264)
a = a + 1
x = x + 1
y = 1







r






share|improve this question







New contributor




Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Mar 21 at 15:04









Pedro FerreiraPedro Ferreira

1




1




New contributor




Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Pedro Ferreira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • "OEC" stands for "Observatory of Economic Complexity"

    – Pedro Ferreira
    Mar 21 at 15:23











  • Could you show a sample of the data with dput and what you expect as your result?. Maybe a different package or solution exists?

    – NelsonGon
    Mar 21 at 15:41












  • There are 263 countries listed, that's why I put 264

    – Pedro Ferreira
    Mar 21 at 19:47

















  • "OEC" stands for "Observatory of Economic Complexity"

    – Pedro Ferreira
    Mar 21 at 15:23











  • Could you show a sample of the data with dput and what you expect as your result?. Maybe a different package or solution exists?

    – NelsonGon
    Mar 21 at 15:41












  • There are 263 countries listed, that's why I put 264

    – Pedro Ferreira
    Mar 21 at 19:47
















"OEC" stands for "Observatory of Economic Complexity"

– Pedro Ferreira
Mar 21 at 15:23





"OEC" stands for "Observatory of Economic Complexity"

– Pedro Ferreira
Mar 21 at 15:23













Could you show a sample of the data with dput and what you expect as your result?. Maybe a different package or solution exists?

– NelsonGon
Mar 21 at 15:41






Could you show a sample of the data with dput and what you expect as your result?. Maybe a different package or solution exists?

– NelsonGon
Mar 21 at 15:41














There are 263 countries listed, that's why I put 264

– Pedro Ferreira
Mar 21 at 19:47





There are 263 countries listed, that's why I put 264

– Pedro Ferreira
Mar 21 at 19:47












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Pedro Ferreira is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283487%2fgathering-all-available-data-for-a-year-in-oec-library-for-r%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Pedro Ferreira is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Pedro Ferreira is a new contributor. Be nice, and check out our Code of Conduct.












Pedro Ferreira is a new contributor. Be nice, and check out our Code of Conduct.











Pedro Ferreira is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283487%2fgathering-all-available-data-for-a-year-in-oec-library-for-r%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴