Displaying 20 results from an estimated 2000 matches similar to: "Stymied by plyr"
2012 Mar 22
2
Order of terms in formula changes aov() results
Hello, This one is very perplexing. I have teacher observation data,
with factors teacher ID, observer ID, component, grade and subject. When
I do this,
aov(data=ratings.prin.22, rating ~ obsid.f + tid.f + subject.f + grade.f + comp.f)
I get this:
Terms:
obsid.f tid.f grade.f comp.f Residuals
Sum of Squares 306.23399 221.38173 1.70000 14.52831 279.05780
Deg. of
2011 Nov 20
1
Need help with table() and apply()
Hello, I am having trouble getting counts of values in rows of a data
frame. I'm trying to use apply, but it's not working.
This gives a sample of the kind of data I'm working with:
rating.1 <- factor(sample(1:4, size=10, replace=T), levels=1:4)
rating.2 <- factor(sample(1:4, size=10, replace=T), levels=1:4)
rating.3 <- factor(sample(1:3, size=10, replace=T), levels=1:4)
2010 Feb 19
3
Omitting members of a sequence
Hello, this is just a point of curiosity with me. I want a sequence of
numbers from 64 to 70, omitting the 2nd and 4th numbers. I can do it
these ways:
> seq(64, 70)[-c(2, 4)]
[1] 64 66 68 69 70
> foo <- 64:70
> foo[-c(2, 4)]
[1] 64 66 68 69 70
But how come this doesn't work?
> 64:70[-c(2, 4)]
[1] 64 65 66 67 68 69 70
Just wondering.
--
Stuart Luppescu -=- slu .at.
2011 Aug 16
2
Assignment working differently inside ifelse()
Hello all, I need to extract rows and columns from a data frame and put
them in a matrix. In some cases, there are no rows in the data frame
meeting the selection criteria. For those rows I want to put a row of
0's in the matrix. Here's my clumsy code:
tab1.m1 <- matrix(0, nrow=2, ncol=4)
tab1.m1[1,] <- ifelse(length(as.matrix(tab1[tab1$comp==the.comp & tab1$schlid==the.schl
2011 Jan 23
2
Ordering box plots
Hello all, I want box plots by group to display in order of increasing
mean (or median) of each group but can't seem to figure it out and
couldn't find anything on R-seek, either.
My data looks like this:
meas unit sid grade rsprti
1 2.24 1002 99999902 NA 0.8600000
2 3.04 1007 43589520 3 0.9400000
3 4.95 2002 39910470 5 1.5300000
4 2.24 2002 39986280 5
2012 Jun 19
1
Scaling a "density".
Folks,
I have a small dataset of counts of recoveries on defaulted loans:
recoveries<-structure(c(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1,
0, 0, 0, 0, 0, 4, 0, 1, 2, 2, 12), .Dim = c(11L, 2L), .Dimnames = list(
NULL, c("pcts", "counts")))
Here is the data in columnar form:
pcts counts
[1,] 0.0 0
[2,] 0.1 0
[3,] 0.2 0
[4,] 0.3
2010 Mar 10
1
pie EPS BB
Greetings all!
I'm facing a puzzle I have not been able to solve.
I need to make an EPS of a pie-chart (Yes, I know;
please don't bother to tell me! I just need to ...).
I'm trying to do it with pie(), and I want to have
just the plain pie-chart with no annotations. So far
so good: "labels=rep(NA,...)" will do it.
But I want to have it output to an EPS file with the
2010 Jun 29
2
Conditionally constructing columns in a data frame
Hello, I have to construct 5 new columns in a data frame depending on
the value of another of the columns in the data frame. The only way I
could figure out to do this was to subset the data frame five times, do
the variable construction, and then rbind the subsets back together.
Here's part of the code I used:
read001 <- read[read$existstr=="001",]
read001$era1end <- NA
2010 Sep 01
5
[semi-OT] Using fortune() in an email signature
Hello, As you can see from my signature in this message, I use the R
fortune function to generate a fortune, which is then fed to the
signature program, which constructs a named pipe containing the
fortune-bearing sig, which is then included in mail messages. The
problem is that it's got extraneous junk in it and I can't figure out
how to get rid of it. This is the command that generates
2007 Apr 18
1
[Bridge] Problem loading bridge.o
Hello, I want to add wireless capability to my Gentoo-linux based
firewall/router at home, so I bought a Netgear MA311 PCI and installed
the hostap package. I load the hostap_pci module and the wlan0 interface
comes up fine. I can detect the signal from a wireless enabled laptop.
Now I'm thinking I'm going to bridge the wlan0 interface and the eth1
interface, and run the firewall with br0
2002 Aug 02
3
I know this is wrong, but why?
My mind has become corrupted by having to use SAS too much. I wanted to
calculate the difference of elements of two vectors if the signs are the
same. I tried it the corrupted way first:
if (effects1[,3] < 0 & effects0[,3] < 0) {
imprv1 <- effects0[,3] - effects1[,3]
} else if (effects1[,3] > 0 & effects0[,3] > 0) {
imprv1 <- effects1[,3] - effects0[,3]
} else {
2002 May 19
3
How to shade part of a density plot
I'm trying to shade part of a density plot. The code I'm trying (using
the Old Faithful data as an example) is something like this:
# The Old Faithful geyser data
data(faithful)
d <- density(faithful$eruptions, bw = "sj")
plot(d)
polygon(d[d$x>4], col = "wheat")
I expected that the part of the curve to the right of 4 on the x axis
should be shaded, but nothing
2010 Apr 06
2
help in function in R akin to macro in SAS
Dear Whom it may concern,
I need help to figure the "macro" function in R: I need to plot the
different data sets by a plotxyf function, I want the title to be different
for different data set.
# get the data set
final.xyf<- xyf(data=as.matrix(my.final),
Y=classvec2classmat(final$outcome), xweight = 0.5, grid=somgrid(5, 4,
"hexagonal"))
#plot function
2004 Oct 11
3
split and rlm
Hello, I'm trying to do a little rlm of some data that looks like this:
UNIT COHORT perdo adjodds
1010 96 0.39890 1.06894
1010 97 0.48113 1.57500
1010 98 0.36328 1.21498
1010 99 0.44391 1.38608
It works fine like this: rlm(perdo ~ COHORT, psi=psisquare)
But the problem is that I have about 100 UNITs, and I want to do a
2010 Apr 02
0
BATCH jobs taking too much resources?
Is there something unusual about the way BATCH jobs are run? I ran a job
like this:
nice R CMD BATCH program.R
It ran for a little while and then it starting eating up huge amounts of
resources. Here is the entry from top:
top 17:34:10 up 36 days, 8:10, 4 users, load average: 13.11, 6.85, 3.7 0
Tasks: 173 total, 6 running, 167 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.1%us, 99.4%sy,
2010 Jul 05
3
How to determine if R is 64 bit compiled under Unix-alike?
Under MacOS I had R64 executive and it was clear. Under Ubuntu, which I
do not have administrative rights to, there is only R executive. It
seems that I can allocate more than 3GB of memory, however not
everything seems to work the same/right as with R64 under MacOS.
Pms.
2010 Jul 14
1
Multilevel IRT Modelling
Dear All,
does anybody know of a package (working under Linux) for multilevel IRT
modelling?
I'd love to do this without having to go on WINSTEPS or the like..
thanks for the attention!
Federico Andreis
-----
Dr. Federico Andreis
Universit? degli Studi di Milano-Bicocca, PhD Student
MEB Department, Karolinska Institutet, Stockholm, Visiting PhD Student
--
View this message in context:
2002 Sep 05
1
Trouble installing packages in Gentoo Linux
I'm trying to install packages in Gentoo Linux using install.packages().
The packages download fine, but when it comes to installation, I get
this message:
WARNING: ignoring environment value of R_HOME
/var/tmp/portage/R-1.5.1/image//usr/lib/R/bin/Rcmd:
/var/tmp/portage/R-1.5.1/image//usr/lib/R/bin/Rcmd: No such file or
directory
I have the R_HOME set to the correct value (/usr/lib/R), but I
2002 May 06
1
Did something big change in 1.5?
I can't remember the programming term -- ``implicit declaration''? Has
this changed between 1.4.1 and 1.5? This code used to run as is:
for (i in 1:length(diff.time)) {
if (diff.time[i] < 16) {
total.time[i] <- ifelse(i==1, 7.5, total.time[i-1]) + diff.time[i]
last.time[i] <- 0
}
else {
total.time[i] <- 7.5
last.time[i-1] <- 1
}
}
Now in 1.5 I
2002 Oct 11
1
Any MD5 digests for source files?
Do MD5 digests exist somewhere for the source packages? If not, is there
some other way to verify the integrity of the files we've downloaded?
Thanks.
--
Stuart Luppescu -=- s-luppescu at uchicago.edu
University of Chicago -=- CCSR
$B:MJ8$HCRF`H~$NIc(B -=- Kernel 2.4.19-xfs-r1
There *is* no such thing as a civil engineer.
-------------- next part