我使用ANTLRWorks来获得简单的语法:
grammar boolean;
// [...]
lowercase_string
: ('a'..'z')+ ;
Run Code Online (Sandbox Code Playgroud)
但是,根据口译员的lowercase_string
不符foobar
(MismatchedSetException(10!={})
.想法?
我有8个不同长度的数据向量(MAP分数)(不同的文档数量),从80到500.如何将它们读取到R并在ggplot2中将它们绘制成相同的长度?考虑它们不同数量的数据点,范围从0到1.它们应按比例缩小/缩小,以便它们适合相同的图形.并为图片添加更平滑的效果.分数范围从0到1.例如,我有矢量
vec1 = [1,0.8,0.6,0.8,0.6,0.6] # => +
vec2 = [1,0.8,0.6,0.4] # => *
Run Code Online (Sandbox Code Playgroud)
情节应如下:
+
+* +
+ *+ +
*
Run Code Online (Sandbox Code Playgroud)
但有线条.
我想通过stdin通过二进制运行一些代码并粘贴输出。语言是foma,有没有一种快速的方法,还是我必须编写自己的定义?我已经尝试过http://sprunge.us/DjOV,但这给了我一个if: Wrong type argument: stringp, (:colname-names)
。
我已经编写了自己的小语言来显示树木 - 这只是一些字符串替换tkiz-qtree
.我可以以某种方式禁用该语言的安全问题吗?我正在养成y
出口时打6次的习惯.
我有一个包含多个浮点行的表,我想对每个行进行四舍五入。
+------------+-------------|
| 445.211219 | 1679.315626 |
| 415.789521 | 1566.561511 |
| 435.918622 | 1689.427872 |
+------------+-------------|
| 424.203660 | 1592.293310 |
| 400.164057 | 1628.415460 |
| 410.473361 | 1507.498568 |
+------------+-------------|
| 463.528003 | 1593.778433 |
| 459.144001 | 1487.695008 |
| 338.498464 | 1459.291475 |
Run Code Online (Sandbox Code Playgroud)
所以我的第一个方法是
#+TBLFM: $3=round($3) $4=round($4)
Run Code Online (Sandbox Code Playgroud)
但这会产生
+----+-------------|
| 0 | 1679.315626 |
| 0 | 1566.561511 |
| 0 | 1689.427872 |
+----+-------------|
| 0 | 1592.293310 |
| 0 | 1628.415460 …
Run Code Online (Sandbox Code Playgroud) 我有两个结构:
max_map <-
structure(list(name = structure(1:11, .Label = c("2-Acetylaminofluorene",
"amsacrine", "aniline", "aspartame", "cyclophosphamide", "doxorubicin",
"indomethacin", "phenacetin", "quercetin", "raloxifene", "urethane"
), class = "factor"), value = c(0.811811403850414, 0.8670680916324,
0.794704077953131, 0.652724115286456, 0.946812003911574, 0.94467294086402,
0.99210186168903, 0.965998352825426, 0.953645104970837, 0.903845608662668,
0.858610554863266)), .Names = c("name", "value"), row.names = c(NA,
-11L), class = "data.frame")
maps <-
structure(list(name = c("2-Acetylaminofluorene", "amsacrine",
"aniline", "aspartame", "cyclophosphamide", "doxorubicin", "indomethacin",
"phenacetin", "quercetin", "raloxifene", "urethane"), avg_relations_fan = c(0.596381660936706,
0.627169363301574, 0.52144016932515, 0.335756276148214, 0.710245148396949,
0.786168090022777, 0.931928694886563, 0.797790600434933, 0.836458734127729,
0.764397331494529, 0.548648356310039), baseline = c(0.441175818174093,
0.661376446637227, 0.470246408568704, …
Run Code Online (Sandbox Code Playgroud) 我想绘制他严重偏差的数据[1] ecdf
.代码是
df <- data.frame(x=eval(parse(file("http://sprunge.us/XYJK"))))
ggplot(df, aes(x=x)) + xlim(0,100) + geom_line(stat='ecdf')
Run Code Online (Sandbox Code Playgroud)
如您所见,该行在100处达到100%,这意味着排除了超过100的数据.我能以某种方式包括它们吗?
为了生成随机双精度数,有 drand48,但是
这些函数被 SVID 3 声明为过时,其中规定应使用 rand(3) 代替。
如何使用 drand48 构建随机双精度?顺便说一句,随机浮动?
简单地连接两个int
fromrand()
并进行强制转换可能会导致
NaN
,这是不可接受的。我想避免仅使用 32 个随机位作为双精度数。