重返江南

1

摄于良渚遗址 - 2020 年 6 月

我和我弟

摄于良渚遗址 - 2020 年 6 月

有两年多没去大城市,也有好些年没见过弟弟了,他还是那么瘦,脸上洋溢着充满阳光的笑容。是啊!想想我俩所走的不同的道路,尽管出生在不那么幸福的家庭,他所经历的比我可要顺利的多。即便只相差两岁,我俩的个性却截然不同。他比我专注,学业稳定,考入名牌大学,毕业后找一份好工作也就顺理成章。多年未见,他还是老样子,也许我也还是老样子,相见无需多言,还是那个熟悉的兄弟,七分相像,三分的不同,却引向各自迥异的命运。

浅析ggplot `aes(group=var)`的用法

p1 <- ggplot(diamonds2, aes(x = cut, price)) + geom_boxplot() p2 <- ggplot(diamonds2, aes(x = cut, price, fill = clarity)) + geom_boxplot() cowplot::plot_grid(p1, p2, nrow = 1)

rowwise manipulation of data frame in R

url <- "https://www.pesmaster.com/arsenal/pes-2020/team/101/" html <- read_html(url) players <- html_nodes(html, ".squad-table") %>% html_table() %>% [[(1) %>% arrange(desc(Ovr)) %>% slice(1:10) %>% select(Name, Pas:Dri) %>% column_to_rownames("Name") %>% t() %>% as.data.frame() names(players) <- stringi::stri_trans_general(names(players), "latin-ascii") %>% # convert to latin-ascii make.names() %>% # valid names str_replace_all(".*\.+", "") # family name ggplot(skillful_player_split, aes(x = ability, y = value)) + geom_col(aes(fill = ability)) + geom_text(aes(x = x, y = y, label = label), data = player_label)

R packages: How to solve the check NOTE "no visible binding for global variable"

While our package employ a function using Non Standard Evaluation (NSE), such as data.table and many tidyverse packages, R CMD check will generate NOTEs in the form “no visible binding for global variable xxx”. There are two ways to solve this problem First, add utils::globalVariables(c("xxx")) to your code, perhaps in R/globals.R. I recommand add it to the R file which caused the NOTE. Apprantly, utils packaage should be added to the Imports filed of DESCRIPTION file.