我刚刚更新到R 2.11.1,安装ggplot2之后,我试过了
library(ggplot2)
Run Code Online (Sandbox Code Playgroud)
得到了
Loading required package: proto
Loading required package: grid Loading
required package: reshape Loading
required package: plyr Loading
required package: digest Error in
eval(expr, envir, enclos) : could not
find function "proto" In addition:
Warning message: In library(package,
lib.loc = lib.loc, character.only =
TRUE, logical.return = TRUE, :
there is no package called 'proto'
Error : unable to load R code in
package 'ggplot2' Error:
package/namespace load failed for
'ggplot2'
Run Code Online (Sandbox Code Playgroud)
任何帮助赞赏.
我正在使用igraph做一些网络分析.作为其中的一部分,我必须创建一个矩阵,其中包含2列和链接的行数.我有一个大型网络(几百万个链接),并且在运行3小时后创建此矩阵不起作用(没有错误,没有结果,并且显示"没有响应").
这种字符矩阵的最大大小是多少?运行需要多长时间?
我在Windows 7机器上运行64位R 2.14.1,4 GB内存以2.67 Ghz运行
谢谢
添加感谢您的快速回复.这使我肯定它不是矩阵的大小; 事实证明,我正在使用另一个矩阵的列来创建该矩阵.
我正在阅读,我自己(不是HW)关于编程,一个练习涉及在R中编写Pascal的三角形.我的第一个想法是制作一个列表,然后将其添加到其中,但这并不能很好地工作.然后我想到了从一个向量开始,并在最后制作一个列表.然后我想到制作一个矩阵,并在最后制作一个列表.
不知道哪种方式可以解决这个问题.
任何提示?
谢谢
客户端向我发送了一个Excel文件,其日期格式为3月15日的3/15/2012.我将其保存为.csv文件然后使用
camm$Date <- as.Date(camm$Date, "%m/%d/%y")
Run Code Online (Sandbox Code Playgroud)
但这给了我从2020年开始的价值!
我试图重新格式化原始csv文件中的日期,以便它们是例如03/14/2013但是无法这样做.
任何帮助赞赏
我party
在R中使用包
我想从结果树的各个节点获得各种统计数据(平均值,中位数等),但我看不出如何做到这一点.例如
airq <- subset(airquality, !is.na(Ozone))
airct <- ctree(Ozone ~ ., data = airq,
controls = ctree_control(maxsurrogate = 3))
airct
plot(airct)
Run Code Online (Sandbox Code Playgroud)
导致具有4个终端节点的树.如何获得每个节点的平均空气质量?
我在LaTeX工作,当我创建一个pdf文件(使用LaTeX按钮或pdfLaTeX按钮或使用yap)时,pdf只有前两页.没有错误.它就停止了.如果我通过添加文本使第一页更长,它仍然在第2页的末尾停止.有任何想法吗?
好的,回复第一条评论,这是代码
\documentclass{article}
\title{Outline of Book}
\author{Peter L. Flom}
\begin{document}
\maketitle
\section*{Preface}
\subsection*{Audience}
\subsection*{What makes this book different?}
\subsection*{Necessary background}
\subsection*{How to read this book}
\section{Introduction}
\subsection{The purpose of logistic regression}
\subsection{The need for logistic regression}
\subsection{Types of logistic regression}
\section{General issues in logistic regression}
\subsection{Transforming independent and dependent variables}
\subsection{Interactions}
\subsection{Model selection}
\subsection{Parameter estimates, confidence intervals, p values}
\subsection{Summary and further reading}
\section{Dichotomous logistic regression}
\subsection{Introduction, theory, examples}
\subsection{Exploratory plots and analysis}
\subsection{Basic model fitting}
\subsection{Advanced and special issues …
Run Code Online (Sandbox Code Playgroud) 我编写了一个程序,可以解决3n + 1问题(又名"奇妙的数字"和其他各种事情).但它有一个双循环.我怎么能把它矢量化呢?
代码是
count <- vector("numeric", 100000)
L <- length(count)
for (i in 1:L)
{
x <- i
while (x > 1)
{
if (round(x/2) == x/2)
{
x <- x/2
count[i] <- count[i] + 1
} else
{
x <- 3*x + 1
count[i] <- count[i] + 1
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
进一步更新
没有输入,因为程序会创建数据.
下面的代码适用于前两位患者,但我想把它放在一个循环中; 最终将有200名患者.抱歉长度.
s <- 42 #SHOULD BE 42
p <- 30 #SHOULD BE 400
p1 <- 8 #Should be 8
m <- 2 #shou;ld be higher
w <- 2
#CAPITAL LETTERS are counting versions of the lowercase
numses <- 12
mult <- 1
maxses <- round(mult*numses,0)
drop = .3; titrate = .2; complete = .3; noise = .5; other = .1
dropskip = .3; titrateskip = .2; completeskip = .3; noiseskip = .5; otherskip = .1;
dropnew = …
Run Code Online (Sandbox Code Playgroud) 我想根据我提供的概率将主题分配到课程.我将在各种情况下使用不同的值来执行此操作.有时,我希望特定类的概率为0.我一直在使用
classlist <- cut(runif(p), c(0, pdrop, ptitrate, pcomplete, pnoise, 1), labels = c("D", "T", "C", "N", "O"))
Run Code Online (Sandbox Code Playgroud)
但是当两个p变量相同时,这就失败了.我可以通过最小量使它们不同,例如pdrop = .2 ptitrate = .200001.但是有更好的方法吗?
谢谢
彼得