这是使用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但它总是画到情节结束.
我有一维向量值。我想将它们转换为带有逗号分隔值的字符串。朱莉娅有一个简单的方法可以做到这一点吗?像崩溃一样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) 我正在尝试依赖于 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) 您有什么方法可以通过存储在字符中的查询来过滤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) 我正在尝试使用 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)