Displaying 20 results from an estimated 7000 matches similar to: "Making a data frame into a factor ?"
2007 Mar 14
2
Connecting R-help and Google Groups?
This morning I tried to see if I could find the r-help mailing list on
Google Groups, which has an interface that I like. I found three
Google Groups ("The R Project for Statistical Computing", "rproject",
and "rhelp") but none of them are connected to the r-help list.
Is there perhaps some reason why it wouldn't be a good thing for there
to be a connected
2007 Apr 16
2
Plotting data with a fitted curve
Suppose you have a vector of data in x and response values in y. How
do you plot together both the points (x,y) and the curve that results
from the fitted model, if the model is not y ~ x, but a higher order
polynomial, e.g. y~poly(x,2)? (In other words, abline doesn't work
for this case.)
Thanks,
--Paul
--
Paul Lynch
Aquilent, Inc.
National Library of Medicine (Contractor)
2007 Mar 29
3
Vector indexing question
Suppose you have 4 related vectors:
a.id<-c(1:25, 1:25, 1:25)
a.vals <- c(101:175) # same length as a.id (the values for those IDs)
a.id.levels <- c(1:25)
a.id.ratings <- rep(letters[1:5], times=5) # same length as a.id.levels
What I would like to do is specify a rating from a.ratings (e.g. "e"),
get the vector of corresponding IDs from a.id.levels (via
2008 Oct 11
1
Download page for mongrel_cluster?
Is there a download page for mongrel_cluster? I see that "gem install
mongrel_cluster" works, but I can''t see where it''s coming from.
Usually gems have some sort of project page somewhere.
--
Paul Lynch
Aquilent, Inc.
National Library of Medicine (Contractor)
2007 Dec 17
3
are index files cross-platform?
Hello!
I am trying to read Ferret index files from Windows machine on my Mac
G5 Leopard machine, but the following returns nil:
Ferret::Index::IndexReader.new( index_paths )
Should this work? Are index files guaranteed to be platform
independent or not? Is there any problem if files (top direectory)
are renamed?
izidor
P.S. I can create the index myself and then everything works.
2007 Mar 23
2
Fitting a line to a qqplot's points?
I've made some normal plots of my data using qqplot, and now
I would like to fit a line to the points on the plot and
check the correlation coefficient to have a more objective measure
of how straight the line is. Is there a simple way of doing that?
(I'm still pretty new to R.)
Thanks,
--Paul
--
Paul Lynch
Aquilent, Inc.
National Library of Medicine (Contractor)
2007 Feb 12
2
make check failure, internet.Rout.fail, Error in strsplit
I'm trying to build R on RedHat EL4. The compile went fine, but a
make check ran into a problem and produced a file
"internet.Rout.fail". Judging by the last part of that file, it was
trying to run an R routine called "httpget" to retrieve the URL
http://www.stats.ox.ac.uk/pub/datasets/csb/ch11b.dat. The precise
error it encountered was:
Error in
2008 Feb 09
2
md5 hash is wrong for 2.6.2 (Windows)
Hi,
I've downloaded R-2.6.2-win32.exe (base) from two CRAN sites
(http://mirrors.ibiblio.org/pub/mirrors/CRAN/ and
http://lib.stat.cmu.edu/R/CRAN/) and for both of those sites the
expected MD5 hash is reported to be:
ed512872818707f27ca05f08be7363c2 *R-2.6.2-win32.exe
(See, for example, http://lib.stat.cmu.edu/R/CRAN/bin/windows/base/md5sum.txt).
However, when I compute the MD5
2007 Jan 14
4
Controlling size of boxplot when it is added in a plot
Greetings,
I am trying to add a boxplot to the bottom of a histogram, right
between the histogram bars and the x axis. Here is the code I am
using at the moment (the par line is probably not relevant for our
discussion):
hs <- hist(x, breaks = 20, plot = F)
par(mar = c(3,3,2,1))
hist(x, breaks = 20, main = NULL, ylim = c(-2, max(hs$counts)))
boxplot(x, horizontal = T, axes = T, add =
2007 Mar 01
2
R code for "Statistical Models in S" ?
I just acquired a copy of "Statistical Models in S", I guess most
commonly known as the "white book", and realized to my dismay that
most of the code is not directly executable in R, and I was wondering
if there was a source discussing the things that are different and
what the new ways of calling things are.
For instance, the first obstacle was the solder.balance data
2007 Feb 04
4
Reading expressions from character vectors
Greetings,
I have a problem that I am sure is very straightforward, but I just
can't wrap my head around it. I've read the help pages on text,
plotmath, expression, substitute, but somehow I can't find the answer
to this simple question.
Basically consider the following example:
plot( NULL, xlim = c(0,2), ylim = c(0,2) )
expressions <- expression( -infinity, infinity )
2007 Feb 22
1
Cross-tabulations next to each other
I have the following relatively simple problem. Say we have three
factors, and we want to create a cross-tabulation against each of the
other two:
x <- factor(rbinom(5, 1, 1/2))
y <- factor(rbinom(5, 1, 1/2))
z <- factor(rbinom(5, 1, 1/2))
table(x,y)
table(x,z)
This looks like:
y
x 0 1
0 2 0
1 1 2
z
x 0 1
0 1 1
1 2 1
I would like to get (surely this will
2008 Mar 05
4
vertex labels in igraph from adjacency matrix
I am getting some unexpected results from some functions of igraph and
it is possible that I am misinterpreting the vertex numbers. Eg., the
max betweenness measure seems to be from a vertex that is not connected
to a single other vertex. Below if my code snippet:
require(igraph)
my.graph <- graph.adjacency(adjmatrix = my.adj.matrix, mode=c("undirected"))
most.between.vert <-
2008 Mar 10
3
Weighting data when running regressions
Dear R-Help,
I'm new to R and struggling with weighting data when I run regression. I've
tried to use search to solve my problem but haven't found anything helpful
so far.
I (successfully) import data from SPSS (15) and try to run a linear
regression on a subset of my data file where WEIGHT is the name of my
weighting variable (numeric), e.g.:
library(foreign)
2007 Dec 17
3
Cannot grasp how to apply "by" here...
I have a data frame named "database" with panel data, a little piece
of which looks like this:
Symbol Name Trial Factor1 Factor2
External
1 548140 A 1 -3.87
-0.32 0.01
2 547400 B 1 12.11
-0.68 0.40
3 547173 C 1
2007 May 17
4
R2 always increases as variables are added?
Hi, everybody,
3 questions about R-square:
---------(1)----------- Does R2 always increase as variables are added?
---------(2)----------- Does R2 always greater than 1?
---------(3)----------- How is R2 in summary(lm(y~x-1))$r.squared
calculated? It is different from (r.square=sum((y.hat-mean
(y))^2)/sum((y-mean(y))^2))
I will illustrate these problems by the following codes:
2008 May 23
2
About Passing Arguments to Function
Hi,
Below I have a function mlogl_k,
later it's called with "nlm" .
__BEGIN__
vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8)
mlogl_k <- function( k_func, x_func, theta_func, samp) {
tot_mll <- 0
for (comp in 1:k_func) {
curr_mll <- (- sum(dgamma(samp, shape = x_func,
scale=theta_func, log = TRUE)))
tot_mll <- tot_mll + curr_mll
}
2007 Nov 07
3
Indexing, and using an empty string as a name
Hello all,
I ran into the following, to me unexpected, behavior. I have (for
reasons that don't necessarily pertain to the question at hand, hence
I won't go into them) the need/desire to use an empty string for the
name of a vector entry. Perhaps I did not read ?"[" very carefully,
but it seems to me that he following lines should return "1" at the end:
2008 Jun 07
2
Using lm with a matrix?
I'm trying to do a linear regression between the columns of matrices. In
example below I want to regress column 1 of matrix xdat with column1 of ydat
and do a separate regression between the column 2s of each matrix. But the
output I get seems to give correct slopes but incorrect intercepts and
another set of slopes with value NA. How do I do this correctly? I'm after
the slope and
2007 Dec 14
4
rcom close Excel problem
Hello,
I just discovered that I cannot close the Excel application and task
manager shows numerous copies of Excel.exe
I tried both
x$Quit() # shown in the rcom archive
and
x$Exit()
and Excel refuses to die.
Thank you very much.
S.
"You can't kill me, I will not die" Mojo Nixon
I also have a problem with saving. It produces a pop-up dialog and
does
not take my second