how to do? createStyle location the data frame to write df <- res_after_filter_2019_smiles Create a new workbook wb <- createWorkbook("hello_excel") Add a worksheets addWorksheet(wb, "sheet01", gridLines = FALSE) write data to worksheet 1 writeData(wb, sheet = 1, df, rowNames = FALSE) create and add a style to the column headers headerStyle <- createStyle( fontSize = 12, fontColour = "#FFFFFF", halign = "center", fgFill = "#4F81BD", border = "TopBottom", borderColour = "#4F81BD" ) addStyle( wb, sheet = 1, headerStyle, rows = 1, cols = 1:ncol(df), gridExpand = TRUE ) style for body bodyStyle <- createStyle(border = "TopBottom", borderColour = "#4F81BD", fgFill = "#CDEDD0") row_to_color <- df %>% tibble::rowid_to_column(.
背景 pubchunks 的目的是从XML格式的学术文章中获取部分数据。我们不需要了解XML及其所有的格式原理。只需知道我们的文件或XML字符串在哪里以及我们想要每篇文章的哪些部分。然后用户可以组合这些部分并做我们希望下游的任何事情; 例如,分析文本结构
pubchunks中的函数 两个主要功能是:
pub_chunks():获取XML部分 pub_tabularize():强制输出pub_chunks()到data.frame中 pub_guess_publisher():从XML文件或字符串猜测发布者 pub_sections():部分pubchunks知道如何处理 pub_providers():提供者(即发布者)pubchunks知道如何明确处理 支持的出版商 elife plos elsevier hindawi pensoft peerj copernicus frontiers f1000research 支持提取的部分有: Front - 发布者,期刊和文章元数据元素 Body - 文章的正文 Back - 文章的背面,致谢,作者贡献,参考文献 Title - 文章标题 Doi - 文章doi Categories - 发布商的类别,如果有的话 Author - 作者 Aff - 隶属关系(包括作者姓名) Keyword - 关键字 Abstract - 文章摘要 Executive_summary - 文章执行摘要 Refs - 参考文献 Refs_dois - 参考dois - 如果有的话 Publisher - 发布者名称 Journal_meta - 期刊元数据 Article_meta - 文章元数据 Acknowledgments - 致谢 Permissions - 文章权限 History - 日期,收到,出版,接受等 安装 #install.
数据科学自动化 曾今是一个热门话题, 大多数人都在讨论所谓的“自动化”工具, 人们声称他们的工具可以自动化数据科学过程。给人一种错觉, 只要将这些工具与大数据架构相结合就可以解决任何业务问题。
但是其实在实际的数据分析工作中, 自动化建模部分仅仅占到总工作量的10%, 大多数的时间和精力花在了 feature engineering 和 feature selection。 比起构建一个复杂的模型, 我们更应该关注的问题这些问题 例如: 定义要解决的问题,获取数据,探索数据,部署项目,调试和监视, 而这些问题往往都无法完全自动化。
这里 Berry 和 Linoff 从摄影的角度给了一个有趣的比喻:
“The camera can relieve the photographer from having to set the shutter speed, aperture and other settings every time a picture is taken. This makes the process easier for expert photographers and makes better photography accessible to people who are not experts. But this is still automating only a small part of the process of producing a photograph.
Some View From Hadley Pragmatically, if you’re a data scientist, learning the basics of SQL is really important. You should also have a minimal reading knowledge of R and Python, because so many data science teams use both . Then I think you’re better off specializing in one of these two and getting really good at it, rather than spreading yourself too thin and being mediocre at several languages.
python Dynamic typing shallow and deep copy
🐌 I want to … create three normal distribution with purrr::map as simple as possible
🐌 Here’s how to: library(tidyverse) #rnorm(n=5, mean = mu, sd = sigma) #函数的一般形式 black_box <- partial(rnorm, n=5)# 先把不变的固定下来,生成新的黑箱函数,黑箱函数只需要接受 map 传递的参数即可, 其他的参数已经通过 ·partial· 固定下来了 mu <- list(10, 100, -100)# 参数 x sigma <- list(0.01, 1, 10)# 参数 y map2(mu, sigma, ~ black_box(mean=.x, sd=.y)) %>% do.call(cbind, .) ## [,1] [,2] [,3] ## [1,] 10.