小编Poi*_*ien的帖子

在ggplot中绘制这个.控制范围内的y轴线

这是使用base,我可以在其中控制x和y轴范围,其中应该精确绘制线条.

plot(mtcars$mpg, mtcars$hp, ylim = c(0, 400), xlim = c(0, 50), axes = F, xlab  = 'mpg', ylab = 'hp', pch = 16)
axis(side = 2, at = seq(100, 400, 100))
axis(side = 1, at = seq(10, 30, 10))
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

ggplot(data = mtcars, aes(x = mpg, y = hp))+geom_point()+
theme(panel.background = element_blank())+
scale_x_continuous(breaks = seq(10, 30, 10), limits = c(0, 50))+
scale_y_continuous(breaks = seq(100, 400, 100), limits = c(0, 400))
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

如何像基本曲线一样添加轴线?我已经尝试了scale_y_continuous,scale_x_continuous但它总是画到情节结束.

plot axis r ggplot2

8
推荐指数
1
解决办法
926
查看次数

在Julia中将向量折叠为逗号分隔的字符串

我有一维向量值。我想将它们转换为带有逗号分隔值的字符串。朱莉娅有一个简单的方法可以做到这一点吗?像崩溃一样r

{julia}
julia> x = [24,122,63,24,83,56,54,175,11,11,24,51,85,92,74,500,80,127,126,59,111,155,132,202,64,164,1301]
Run Code Online (Sandbox Code Playgroud)
#I want output like this as a string
#24,122,63,24,83,56,54,175,11,11,24,51,85,92,74,500,80,127,126,59,111,155,132,202,64,164,1301,27
Run Code Online (Sandbox Code Playgroud)
#I have tried something like this
[julia> [print(i,",") for i in x]
24,122,63,24,83,56,54,175,11,11,24,51,85,92,74,500,80,127,126,59,111,155,132,202,64,164,1301,27-element Array{Void,1}:
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
 nothing
Run Code Online (Sandbox Code Playgroud)

printing julia

3
推荐指数
1
解决办法
682
查看次数

LD_LIBRARY_PATH:未定义的变量错误

我正在尝试依赖于 MCR 的 matlab 脚本。我有包装脚本,可以在执行实际程序之前为此 MCR 目录设置环境变量。包装器如下。

#!/bin/csh

set thisdir = `pwd`

# --- SET UP ENVIRONMENT VARIABLES ---
echo --- setting up environment variables ---
# presumed location of MATLAB Component Runtime (MCR) v7.14
# if the MCR is in a different location, edit the line below
set mcr_root = /home/foo/MATLAB_Component_Runtime
echo $mcr_root
setenv LD_LIBRARY_PATH $mcr_root/v81/runtime/glnxa64:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $mcr_root/v81/sys/os/glnxa64:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $mcr_root/v81/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $mcr_root/v81/sys/java/jre/glnxa64/jre/lib/amd64/server:$LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH $mcr_root/v81/sys/java/jre/glnxa64/jre/lib/amd64:$LD_LIBRARY_PATH
setenv XAPPLRESDIR $mcr_root/v81/X11/app-defaults
# (these may be set permanently by copying …
Run Code Online (Sandbox Code Playgroud)

matlab csh setenv ubuntu-14.04

1
推荐指数
1
解决办法
5142
查看次数

通过查询字符串过滤data.table

您有什么方法可以通过存储在字符中的查询来过滤data.table吗?对于.恩.

m <- structure(list(Hugo_Symbol = c("ABCA10", "ABCA4", "ABCC3", "ABCG4", 
"ACTBL2", "ADAMTS12", "ADCY5", "ADSS", "AGXT2", "ANG"), Variant_Classification = c("Splice_Site", 
"Missense_Mutation", "Missense_Mutation", "Missense_Mutation", 
"Missense_Mutation", "Missense_Mutation", "Missense_Mutation", 
"Splice_Site", "Missense_Mutation", "Missense_Mutation"), Variant_Type = c("SNP", 
"SNP", "SNP", "SNP", "SNP", "SNP", "SNP", "SNP", "SNP", "SNP"
), Tumor_Sample_Barcode = c("TCGA.AB.2988", "TCGA.AB.2869", "TCGA.AB.2887", 
"TCGA.AB.2934", "TCGA.AB.2931", "TCGA.AB.2945", "TCGA.AB.2833", 
"TCGA.AB.2912", "TCGA.AB.2822", "TCGA.AB.2988")), .Names = c("Hugo_Symbol", 
"Variant_Classification", "Variant_Type", "Tumor_Sample_Barcode"
), row.names = c(NA, -10L), class = c("data.table", "data.frame"
))
Run Code Online (Sandbox Code Playgroud)

过滤

#These work fine
m[Variant_Classification %in% 'Splice_Site']
dplyr::filter(.data = m, filter = …
Run Code Online (Sandbox Code Playgroud)

r dplyr data.table

1
推荐指数
1
解决办法
375
查看次数

ggplot2 箱线图

我正在尝试使用 ggplot2 绘制箱线图。样本数据是这样的。

> sampe

count genotype
71       mt
50       mt
71       mt
95       wt
60       mt
63       mt
75       mt
82       wt
93       wt
87       wt
61       mt
102       wt
60       mt
78       wt
78       wt
87       wt
84       wt
104       wt
81       wt
85       mt


> qplot(factor(genotype),count,data=sampe,geom="boxplot")
Run Code Online (Sandbox Code Playgroud)

上面的命令产生这样的情节: 在此处输入图片说明

这里怎么了??为什么会这样??即使是下面的代码也会产生相同的输出。

ggplot(sampe,aes(x=factor(genotype),y=count))+geom_boxplot()
Run Code Online (Sandbox Code Playgroud)

r ggplot2 boxplot

0
推荐指数
1
解决办法
1546
查看次数

标签 统计

r ×3

ggplot2 ×2

axis ×1

boxplot ×1

csh ×1

data.table ×1

dplyr ×1

julia ×1

matlab ×1

plot ×1

printing ×1

setenv ×1

ubuntu-14.04 ×1