Created
January 29, 2019 06:01
-
-
Save rrodrigueznt/f0a5ab51106a85eb73776c531323a936 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# | |
library(readxl) | |
IGFAE_Budget201901241600 <- read_excel("C:/Users/Ricardo Rodríguez/Desktop/IGFAE.Budget201901241600.xlsx") | |
View(IGFAE_Budget201901241600) | |
# | |
IGFAEBudgetSummary <- aggregate(IGFAE_Budget201901241600$y2019, by=list(IGFAE_Budget201901241600$category), FUN=sum, na.rm=TRUE) | |
sum(IGFAE_Budget201901241600$y2019, na.rm = TRUE) | |
sum(IGFAEBudgetSummary$x) | |
# | |
aggregate(IGFAE_Budget201901241600$amount, by=list(IGFAE_Budget201901241600$year,IGFAE_Budget201901241600$category), FUN=sum, na.rm=TRUE) | |
# | |
attach(IGFAE_Budget201901241600) | |
aggregate(amount, by=list(year,category), FUN=sum, na.rm=TRUE) | |
IGFAEBudgetSumCatYear <- aggregate(amount ~ year*category, IGFAE_Budget201901241600, FUN=sum, na.rm=TRUE) | |
# | |
IGFAEBudgetSumCatYear[,c(2,1,3)] | |
# | |
round(xtabs(amount ~ categoryToReport + year, IGFAE_Budget201901241600)) | |
data01 <- round(xtabs(amount ~ category + year, IGFAE_Budget201901241600)) | |
# | |
# | |
IGFAEB01 <- format(round(xtabs(amount ~ categoryToReport + year, IGFAE_Budget201901241600)),decimal.mark=",", big.mark=".",small.mark=".", small.interval=3, nsmall=0) | |
print(IGFAEB01, quote = FALSE) | |
# | |
#chartr("9"," ",format(round(xtabs(amount ~ categoryToReport + year, IGFAE_Budget201901241600)),decimal.mark=",", big.mark=".",small.mark=".", small.interval=3, nsmall=0)) | |
# | |
# | |
IGFAE_Budget201901241600 <- read_excel("C:/Users/Ricardo Rodríguez/Desktop/IGFAE.Budget201901241600.xlsx") | |
colnames(IGFAE_Budget201901241600)[c(1,3)] <- c("concepto","ano") | |
##sink("C:/Users/Ricardo Rodríguez/Desktop/IGFAE.Budget201901241600.txt") | |
print(format(round(xtabs(amount ~ concepto + ano, IGFAE_Budget201901241600)),decimal.mark=",", big.mark=".",small.mark=".", small.interval=3, nsmall=0), quote = FALSE) | |
##sink() | |
# | |
write.table((format(round(xtabs(amount ~ concepto + ano, IGFAE_Budget201901241600)),decimal.mark=",", big.mark=".",small.mark=".", small.interval=3, nsmall=0), quote = FALSE),"clipboard",sep="\t",col.names=NA) | |
# | |
write.table(xtabs(amount ~ concepto + ano, IGFAE_Budget201901241600),"clipboard",sep="\t",col.names=NA) | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment