310-325-0022

한의원 (PST). John 윤 원장. 나이 좀 든 원장. 웹 사이트 없으며, 한번 방문해 줄 수 있냐고 해서, 알라스카라고 하니, 제가 한번 생각해 보겠습니다, 하고 전화 끊었음 (10/21/2024).

562-924-5230

한의원 (PST). 전화 받은 여인이 홈 페이지 없으나, 나중에 원장과 상의해야 한단다 (10/21/2024).

714-522-1600

한의원 (PST). 홈 페이지 없으나, 지금 환자하고 있다고 해서, 다시 연락 드린다고 하고 끊었음 (10/21/2024).

아는 사람이 제작 중 이란다 (1/27/2026).

R – 2024 10 지출-액수

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 calculate the sum for each item in October 2024
query <- "
SELECT 
    Item, 
    SUM(Pay_Amount) AS Total_Spent
FROM 
    '지출-액수_2024_10_21'
WHERE 
    strftime('%Y-%m', '20' || substr(Date_Transaction, 7, 2) || '-' || substr(Date_Transaction, 1, 2) || '-' || substr(Date_Transaction, 4, 2)) = '2024-10'
GROUP BY 
    Item
ORDER BY 
    Total_Spent DESC;
"

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

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

# Save the result as a CSV file
csv_file_path <- "/home/jbyungrokim/Downloads/October_2024_sum.csv"
write.csv(October_2024_sum, file = csv_file_path, row.names = FALSE)
print(paste("Data has been written to", csv_file_path))

# Create a bar graph using ggplot2
ggplot(October_2024_sum, aes(x = reorder(Item, -Total_Spent), y = Total_Spent)) +
  geom_bar(stat = "identity", fill = "steelblue") +
  theme_minimal() +
  labs(title = "Total Spending by Item for October 2024",
       x = "Item",
       y = "Total Spent ($)") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

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