我想在RMarkdown中创建一个多线方程.我尝试了以下代码,摘自http://www.rstudio.com/ide/docs/authoring/using_markdown_equations,
$$
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x- y - xz
\end{aligned}
$$
Run Code Online (Sandbox Code Playgroud)
然而,针织的HTML文档给出了单线方程:

我安装了以下内容:
我想用自定义CSS创建一个闪亮的演示文稿(RStudio菜单项:文件>新文件> RMarkdow>闪亮>闪亮的演示文稿),但我不确定如何这样做.
我的自定义CSS(目前只更改标题2的颜色)
h2 {
font-size:1.8em;
color: red;
}
Run Code Online (Sandbox Code Playgroud)
使用ioslides网页上的RMarkdown PResentations提供的示例摘录:
---
title: "Habits"
author: John Doe
date: March 22, 2005
output:
ioslides_presentation:
css: temp.css
---
## Getting up
- Turn off alarm
- Get out of bed
Run Code Online (Sandbox Code Playgroud)
但是,当我通过包含runtime: Shiny在前导码中将其转换为生成Shiny输出时,自定义格式不再有效.
---
title: "Habits"
author: John Doe
date: March 22, 2005
runtime: shiny
output:
ioslides_presentation:
css: temp.css
---
## Getting up
- Turn off alarm
- Get out of bed
## …Run Code Online (Sandbox Code Playgroud) 我使用Git作为版本控制(目前是集中式工作流程,但我想转移到功能分支或gitflow工作流程).我使用RStudio/Knitr来编译PDF文档,并想知道如何在PDF中自动包含当前的Git版本 - 如果可行的话?这样,当有人用我给他们的文件回复我时,我知道如何回到代码中的那一点.任何建议将不胜感激,谢谢 - 玛丽.
编辑:关键词是我的想法,虽然根据这篇文章(gelato.unsw.edu.au/archives/git/0610/28891.html)不推荐.有关帮助程序脚本的建议吗? - 刚刚用户1420372
我已经使用DBI::dbGetQuery.
即使在实际查询(不是下面的播放查询)中, I
select convert(date, date_value) as date_value,日期仍然存储为字符。
然后我尝试使用 改变表示日期的字符lubridate::ymd,但是我收到一条消息说
未找到日期值
我也试过,convert(date, date_value)而且as.Date无济于事。
require(dplyr)
if (dbExistsTable(con, "##temp", catalog_name = "tempdb")){
dbRemoveTable(con, "##temp")
}
DBI::dbGetQuery(con, paste(
"select
convert(date, '2013-05-25') as date_value
into ##temp
"))
tbl(con, "##temp")
# Error - date_value not found
tbl(con, "##temp") %>% mutate(date_value= lubridate::ymd(date_value))
# this works
tbl(con, "##temp") %>% mutate(temp= date_value)
# this doesn't work - date value not found
tbl(con, "##temp") %>% mutate(temp= lubridate::ymd(date_value))
Run Code Online (Sandbox Code Playgroud)
如何将此字段用作日期?
注意:当我在 SQL …
我正在尝试使用 python pandas 连接器连接到雪花。
我在 Windows 上使用 anaconda 发行版,但卸载了现有的连接器和 pyarrow,并使用此页面上的说明重新安装:https ://docs.snowflake.com/en/user-guide/python-connector-pandas.html
我有以下版本
熊猫 1.0.4 py37h47e9c7a_0
点 20.1.1 py37_1
pyarrow 0.17.1 pypi_0 pypi
蟒蛇 3.7.7 h81c818b_4
雪花连接器-python 2.2.7 pypi_0 pypi
运行本文档的步骤 2 时:https://docs.snowflake.com/en/user-guide/python-connector-install.html,我得到:4.21.2
尝试使用时fetch_pandas_all()出现错误:NotSupportedError: Unknown error
我使用的代码如下:
import snowflake.connector
import pandas as pd
SNOWFLAKE_DATA_SOURCE = '<DB>.<Schema>.<VIEW>'
query = '''
select *
from table(%s)
LIMIT 10;
'''
def create_snowflake_connection():
conn = snowflake.connector.connect(
user='MYUSERNAME',
account='MYACCOUNT',
authenticator = 'externalbrowser',
warehouse='<WH>',
database='<DB>',
role='<ROLE>',
schema='<SCHEMA>'
)
return conn
con = create_snowflake_connection() …Run Code Online (Sandbox Code Playgroud) 昨天我将R升级到版本3.0.0,将ggplot2升级到版本0.9.3.1(并对我的脚本进行了一些小改动).现在我在尝试保存绘图时遇到错误 - 遗憾的是错误不是用较小的数据帧重现的,所以我已经包含了生成相同大小的代码.
library("ggplot2")
# Create data frame
# Time interval ID (x)
bin.ts.avg <- as.data.frame(rep(1:18, 31))
names(bin.ts.avg) <- "x"
# Time (sequence of 10 minuter intervals between 7am and 10am)
tt.month.bins <- seq(from=as.POSIXct("2012-01-01 GMT"), to=as.POSIXct("2012-01-01 GMT") + 60*60*24*31, by="10 mins")
tt.month.bins <- tt.month.bins[-length(tt.month.bins)]
temp <- as.numeric(format(tt.month.bins, "%H"))
ind <- which(temp >=7 & temp <= 9)
tt.month.bins <- tt.month.bins[ind]
bin.ts.avg$dep <- tt.month.bins
# Value (with some NA)
bin.ts.avg$tt <- runif(558, min=2.5, max=5)
bin.ts.avg$tt[trunc(runif(200, min=1, max=558))] <- NA
# Day
bin.ts.avg$depday …Run Code Online (Sandbox Code Playgroud) 我想在开发脚本时在 R studio 中交互地使用 R 代码(因此依赖于全局环境)(因此无需编写文档) - 单独访问每个块并按下运行块是乏味且容易出错的(我经常丢失块) - 是否有另一种方法来运行 .Rmd 文件的一部分并使变量在全局环境中可用?
nb,我刚刚向 RStudio 提出了一个功能请求,以便能够在选定的代码中运行块 - 但是我会惊讶的是,尚未支持用于跨多个块(无编织)开发/测试 R 代码的推荐方法。
下图与我要找的很接近,但是我想知道以下是否可行:
require(dplyr); require(plotly); require(RColorBrewer); require(stringr)
# Summarise flow data
dat <- data.frame(customer = c(1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 5),
holiday_loc = c("SA", "SA", "AB", "SA", "SA", "SA", "SA", "AB", "AB", "SA", "SA", "SA")) %>%
group_by(customer) %>%
mutate(holiday_num = seq_along(customer),
source=paste0(holiday_loc, '_', holiday_num),
target = lead(source),
last_hol …Run Code Online (Sandbox Code Playgroud) 在使用purrr:map时间序列列表列之后,我最终得到了一个tibble列表中的结果(我可能在这里有一些错误的术语,但希望这个例子可以清除它).是否可以将结果列表中的每一列提取为数据框列而不指定每个列表元素名称?
示例数据:
tmp <- tibble(col1 = c("A1", "A2") ,
col2 = c("B1", "B2"),
col3 = list(
list(x = TRUE, b = list(data.frame(y1=c(1,2,3), y2=c(4,5,6)))),
list(x = FALSE, b = list(data.frame(y1=c(1,2,3), y2=c(4,5,6))))))
Run Code Online (Sandbox Code Playgroud)
所需的输出(但无需键入每列 - 实际上我还有更多):
tmp %>% mutate(x = map(tmp$col3, "x")[[1]],
b = map(tmp$col3, "b")[[1]])
Run Code Online (Sandbox Code Playgroud)
编辑:我已经意识到上面的"手动解决方案"是错误的..我不确定如何手动提取b,但对于x,它应该是:
tmp %>% mutate(x = map_lgl(col3, "x"))
Run Code Online (Sandbox Code Playgroud) 好的,所以我正处于Andrew Ng关于课程的机器学习课程的中间,并且想要调整作为任务4的一部分完成的神经网络.
特别是,我作为任务的一部分正确完成的神经网络如下:
g(z) = 1/(1+e^(-z))
其中L=number of layers,s_l = number of units in layer l,m = number of training examples,K = number of output units
现在我想调整练习,以便有一个连续的输出单元,在[0,1]之间取任何值,我正在尝试找出需要改变的东西,到目前为止我有
其中a_3是从前向传播确定的输出单位的值.我确信其他必须改变,因为梯度检查方法显示由反向传播确定的梯度,并且数值近似不再匹配.我没有改变sigmoid梯度; 则留在f(z)*(1-f(z))其中f(z)是S形函数1/(1+e^(-z))),也没有我更新衍生物式的数值近似; 简单(J(theta+e) - J(theta-e))/(2e).
任何人都可以建议需要采取哪些其他步骤?
在Matlab中编码如下:
% FORWARD PROPAGATION
% input layer
a1 = [ones(m,1),X];
% hidden layer
z2 = a1*Theta1';
a2 = sigmoid(z2); …Run Code Online (Sandbox Code Playgroud)