Skip to content

Instantly share code, notes, and snippets.

@rrodrigueznt
Last active October 12, 2018 18:10
Show Gist options
  • Save rrodrigueznt/41292162090429e6e77cc5ae497a64f8 to your computer and use it in GitHub Desktop.
Save rrodrigueznt/41292162090429e6e77cc5ae497a64f8 to your computer and use it in GitHub Desktop.
IGFAEsp <- read.csv("https://gist.githubusercontent.com/rrodrigueznt/4db766181d58cf571f58ef310adb45bc/raw/cf4b3ed382fff0935d07010c3df09e2543e573bd/IGFAE.sp.20180610000000SCQ.data", header=TRUE, sep=',')
#
IGFAEsp$year <- as.factor(IGFAEsp$year)
#
ggplot(data=IGFAEpublData, aes(x=year, y=tnoa)) + geom_bar(stat="identity", fill="steelblue") + geom_text(aes(label=tnoa), vjust=1.6, color="white", size=6) + scale_x_discrete("ano") + scale_y_continuous("número de artigos")
#
## http://rpubs.com/rrodrigueznt/426766
#
IGFAEfuByYear <- aggregate(IGFAEfu$amount, by=list(Category=IGFAEfu$year), FUN=sum)
#
names(IGFAEfuByYear) <- c('year','amount')
#
IGFAEfuByYear$year <- as.factor(IGFAEfuByYear$year)
str(IGFAEfuByYear)
#
ggplot(data=IGFAEfuByYear, aes(x=year, y=amount)) + geom_bar(stat="identity", fill="steelblue") + xlab("ano") + ylab("euros")
#
ggplot(data=IGFAEfu, aes(x=year, y=amount, fill=source)) + geom_bar(stat="identity", position="stack") + xlab("ano") + ylab("euros")
#
ggplot(data=IGFAEfu, aes(x=year, y=amount, fill=source)) + geom_bar(stat="identity", position=position_dodge()) + xlab("ano") + ylab("euros")
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment