지출-액수 R Bar Graph by Month

library(RSQLite)
library(DBI)
library(ggplot2)

# Define the path to your SQLite database
db_path <- "/home/jbyungrokim/CSV/CSV.db"

# Connect to the SQLite database
conn <- dbConnect(RSQLite::SQLite(), dbname = db_path)

# Corrected query to get the total spending by each item for July 2024, excluding 'Rent - Monthly' and 'Grocery'
query <- "
SELECT 
    Item, 
    SUM(Pay_Amount) AS Total_Spent
FROM 
    '지출-액수_2024_08_17'
WHERE 
    substr(Date_Transaction, 1, 2) = '07' 
    AND substr(Date_Transaction, 7, 2) = '24'
GROUP BY 
    Item
ORDER BY 
    Total_Spent DESC;
"

# Execute the query and store the result in a data frame
july_spending <- dbGetQuery(conn, query)

# Close the connection to the SQLite database
dbDisconnect(conn)

# Create a bar graph using ggplot2
ggplot(july_spending, aes(x = reorder(Item, -Total_Spent), y = Total_Spent, fill = Item)) +
  geom_bar(stat = "identity") +
  labs(title = "Spending Breakdown by Item - July 2024 (Excluding Rent and Grocery)",
       x = "Item",
       y = "Total Spent") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1),
        legend.position = "none")

지출-액수.csv each month Item Sum, R Code

library(RSQLite)
library(DBI)

# Define the path to your SQLite database
db_path <- "/home/jbyungrokim/CSV/CSV.db"

# Connect to the SQLite database
conn <- dbConnect(RSQLite::SQLite(), dbname = db_path)

# Adjust the query to calculate the sum for each item in July 2024
query <- "
SELECT 
    Item, 
    SUM(Pay_Amount) AS Total_Spent
FROM 
    '지출-액수_2024_08_17'
WHERE 
    strftime('%Y-%m', '20' || substr(Date_Transaction, 7, 2) || '-' || substr(Date_Transaction, 1, 2) || '-' || substr(Date_Transaction, 4, 2)) = '2024-03'
GROUP BY 
    Item
ORDER BY 
    Total_Spent DESC;
"

# Execute the query and store the result in a data frame
july_2024_sum <- dbGetQuery(conn, query)

# Print the result
print("Sum of Pay_Amount by Item for March 2024:")
print(july_2024_sum)

# Close the connection to the SQLite database
dbDisconnect(conn)

Stripe month by month revenue graph generating R code

# Install and load the necessary packages.  Below three lines can be dropped after installation once.
install.packages("RSQLite")
install.packages("DBI")
install.packages("ggplot2")
library(RSQLite)
library(DBI)
library(ggplot2)

# Define the path to your SQLite database
db_path <- "/home/jbyungrokim/CSV/CSV.db"

# Connect to the SQLite database
conn <- dbConnect(RSQLite::SQLite(), dbname = db_path)

# Query to calculate the monthly total of the 'gross' field, grouped by year and month
query <- "
SELECT 
    strftime('%Y-%m', created) AS YearMonth, 
    SUM(gross) AS Total_Gross
FROM 
    'Itemized_balance_change_from_activity_USD_2022-03-11_to_2024-08-05_America-Anchorage'
WHERE 
    strftime('%Y-%m', created) IS NOT NULL
GROUP BY 
    YearMonth
ORDER BY 
    YearMonth;
"

# Execute the query and store the result in a data frame
monthly_totals <- dbGetQuery(conn, query)

# Close the connection to the SQLite database
dbDisconnect(conn)

# Convert YearMonth to a Date type for better plotting
monthly_totals$YearMonth <- as.Date(paste0(monthly_totals$YearMonth, "-01"), format = "%Y-%m-%d")

# Create a line plot using ggplot2
ggplot(monthly_totals, aes(x = YearMonth, y = Total_Gross)) +
  geom_line(color = "blue", linewidth = 1) +  # Updated to use 'linewidth' instead of 'size'
  geom_point(color = "red", size = 2) +
  labs(title = "Monthly Total Gross Over Time",
       x = "Month-Year",
       y = "Total Gross") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

지출-액수.csv PIE Graph with exclusions of items in R

# Install and load the necessary packages. Below three lines can be dropped if installed already.
install.packages("RSQLite")
install.packages("DBI")
install.packages("ggplot2")  # This package is used for plotting
install.packages("ggrepel")  # This package is used to avoid label clustering
library(RSQLite)
library(DBI)
library(ggplot2)
library(ggrepel)

# Define the path to your SQLite database
db_path <- "/home/jbyungrokim/CSV/CSV.db"

# Connect to the SQLite database
conn <- dbConnect(RSQLite::SQLite(), dbname = db_path)

# Corrected query to get the total spending by each item for July 2024, excluding 'Rent - Monthly' and 'Grocery'
query <- "
SELECT 
    Item, 
    SUM(Pay_Amount) AS Total_Spent
FROM 
    '지출-액수_2024_08_17'
WHERE 
    substr(Date_Transaction, 1, 2) = '07' 
    AND substr(Date_Transaction, 7, 2) = '24'
    AND Item NOT IN ('Rent - Monthly', 'Grocery')
GROUP BY 
    Item
ORDER BY 
    Total_Spent DESC;
"

# Execute the query and store the result in a data frame
july_spending <- dbGetQuery(conn, query)

# Close the connection to the SQLite database
dbDisconnect(conn)

# Create a pie chart using ggplot2 and ggrepel
ggplot(july_spending, aes(x = "", y = Total_Spent, fill = Item)) +
  geom_bar(width = 1, stat = "identity") +
  coord_polar("y") +
  labs(title = "Spending Breakdown by Item - July 2024 (Excluding Rent and Grocery)") +
  theme_minimal() +
  theme(axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        panel.grid = element_blank(),
        axis.text.x = element_blank(),
        axis.ticks = element_blank()) +
  geom_text_repel(aes(label = paste0(round(Total_Spent / sum(Total_Spent) * 100, 1), "%")),
                  position = position_stack(vjust = 0.5),
                  box.padding = 0.5,
                  direction = "y",
                  segment.color = "grey50")

지출-액수.csv monthly sum by Item using R

# Install and load the necessary packages. Below two lines can be dropped after installing once.
install.packages("RSQLite")
install.packages("DBI")
library(RSQLite)
library(DBI)

# Define the path to your SQLite database
db_path <- "/home/jbyungrokim/CSV/CSV.db"

# Connect to the SQLite database
conn <- dbConnect(RSQLite::SQLite(), dbname = db_path)

# Adjust the query to handle the MM/DD/YY format
query <- "
SELECT 
    strftime('%Y-%m', '20' || substr(Date_Transaction, 7, 2) || '-' || substr(Date_Transaction, 1, 2) || '-' || substr(Date_Transaction, 4, 2)) AS YearMonth, 
    SUM(Pay_Amount) AS Total_Spent
FROM 
    '지출-액수_2024_08_17'
WHERE 
    Item = 'Grocery'
GROUP BY 
    YearMonth
ORDER BY 
    YearMonth;
"

# Execute the query and store the result in a data frame
monthly_sum <- dbGetQuery(conn, query)

# Print the result
print("Monthly Sum of Pay_Amount for Grocery Items by Year and Month:")
print(monthly_sum)

# Close the connection to the SQLite database
dbDisconnect(conn)

지출-액수.csv R Graph

# Install and load the necessary packages. After installing once, below 3 lines can be dropped.
install.packages("RSQLite")
install.packages("DBI")
install.packages("ggplot2")  # This package is used for plotting
library(RSQLite)
library(DBI)
library(ggplot2)

# Define the path to your SQLite database
db_path <- "/home/jbyungrokim/CSV/CSV.db"

# Connect to the SQLite database
conn <- dbConnect(RSQLite::SQLite(), dbname = db_path)

# Adjust the query to handle the MM/DD/YY format
query <- "
SELECT 
    strftime('%Y-%m', '20' || substr(Date_Transaction, 7, 2) || '-' || substr(Date_Transaction, 1, 2) || '-' || substr(Date_Transaction, 4, 2)) AS YearMonth, 
    SUM(Pay_Amount) AS Total_Spent
FROM 
    '지출-액수_2024_08_17'
WHERE 
    Item = 'Grocery'
GROUP BY 
    YearMonth
ORDER BY 
    YearMonth;
"

# Execute the query and store the result in a data frame
monthly_sum <- dbGetQuery(conn, query)

# Close the connection to the SQLite database
dbDisconnect(conn)

# Create a plot using ggplot2
ggplot(monthly_sum, aes(x = YearMonth, y = Total_Spent)) +
  geom_line(group = 1, color = "blue") + 
  geom_point(color = "red") +
  labs(title = "Monthly Grocery Spending",
       x = "Year-Month",
       y = "Total Spent on Groceries") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

OKBestMoving.com

Google Business, website 등록 필요 (8/12/2024).

OKBestMoving.com Google Business에 등록하라고 Oki씨에게 얘기했음 (8/12/2024).

myswifttaxi.com

8282nytaxi.com과 유사하게 웹 사이트 방문자가 방문했을 때 알찬 내용이 전달되게 바꾸기 희망 (8/11/2024).

myswifttaxi.com

Google AdWords 내역 확실히 좀 알아 봐 달라고 부탁했음 (8/12/2024).

201-398-3109

우리 택시 뉴저지 소개 케이스.

작년에 설립된 회사. 설립 기간이 짧으니 웹 사이트에 설립 년도는 넣지 않기로 했음. 다음 주 말 즈음에 완성된다고 하니, 인보이스 좀 보내 주세요, 함 (8/21/2024).

웹 사이트 완성해서 인보이스 월 $45 보냈음. 인보이스 처리하면 DongIck.1004Site.com으로 올려 준다고 했음 (8/25/2024).

DongIck.com – this is the domain, 이 동익 사장 wants. Paid $45 through Credit Card pix texted in (9/2/2024).

He does not want Yoast service @$99/year, not yet. Maybe later (9/2/2024).