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
options(stringsAsFactors = FALSE) | |
library(tidyverse) | |
library(xml2) | |
library(lubridate) | |
# Your codebase is well-structured and clear. It effectively uses the `tidyverse` and `xml2` libraries to process and manipulate the XML data. The comments are helpful in understanding the steps involved in exporting and processing the Apple Health data. Overall, it looks like a solid foundation for further development and analysis. | |
# NOTE: double check that week and past_week have the right days in them | |
# | |
# Process the XML file obtained from the Apple Health App. To get this file |
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
# Control Statements | |
# Load the tidyverse package | |
library(dplyr) | |
# Create a sample data frame | |
data <- data.frame( | |
day = c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday") | |
) |
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
pg_ctl -D /Users/campbellm/postgres/bccc -l logfile start |
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
-- SELECT WITH GROUP BY AND JOIN | |
SELECT | |
C.country, | |
C.team, | |
SUM(M.goals) | |
FROM countries AS C | |
LEFT JOIN matches AS M | |
ON C.team_id = M.home_team_id | |
WHERE M.year > 1990 | |
GROUP BY |
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
INSERT INTO TargetTable | |
SELECT * FROM SourceTable; | |
INSERT INTO Orders (CustomerID, OrderDate, TotalAmount) | |
VALUES | |
(1, '2023-09-19', 100.50), | |
(2, '2023-09-18', 75.25), | |
(3, '2023-09-17', 150.00); |
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(tidyverse) | |
library(lubridate) | |
library(lutz) | |
library(maptools) | |
datadir <- sprintf("%s/%s", here::here(), "04.findings.1/data") | |
load(file = sprintf("%s/%s", datadir, "nuforc_reports.rdata")) | |
# CLEAN AND CATEGORIZE |
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(ggplot2) | |
wiche_us <- lookup_wiche(year = 2006, gender = c("f", "m")) | |
ggplot(data = wiche_us, aes(gender, n)) + | |
geom_bar(stat = "identity", position = "dodge") | |
wiche_us <- lookup_wiche( | |
year = 2006, | |
race = c("white", "asian", "hispanic", "native", "black") | |
) |
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
# stringdist | |
m <- stringdist(d$last_name_s, d$last_name_d, method = "lv") | |
# adist, provides matrix of every combo | |
s <- data.frame(list(person = c("ABCDEFG", | |
"ABCDEFG", | |
"ABCDEFG", |
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
df[is.na(df)] <- "*" |
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
GRANT SELECT ON DATABASE.TABLE TO user_name; | |
USE WorkdayStudent; | |
GRANT UPDATE, INSERT, DELETE TO campbellma; |
NewerOlder