Displaying 20 results from an estimated 3000 matches similar to: "Names of data frame columns in an apply"
2001 Feb 21
1
Specification of factors in tapply
After some fiddling around with the tapply command, I discovered that the
factors (the INDEX argument) given to tapply must be specified in
fastest-cycling first order.
The following code shows how I discovered my error: (R version 1.2.1)
-o-o-o-o-o-
x <- as.data.frame(list(data=c(-9,0,3,1,-9,1,0,-9,0,3,1,-9,1,0),
subj=c(rep(1,7),rep(2,7)),
2002 Jul 16
2
selectively aggregate data
I'm shure that this kind of question is asked not for the fist time, but
i would be glad if someone of you could help me out
I have a data.frame like this :
subjnr group block data
1 33 1 1 564.476
2 33 1 1 289.185
3 33 1 1 483.372
4 33 1 1 1461.260
5 33 1 1 315.353
6 33 1 1 351.870
7 33
2002 Jul 28
1
[R] bug in unsplit()? (PR#1843)
Hedderik van Rijn <hedderik@cmu.edu> writes:
> If the second argument to unsplit is not a simple vector (but a "list
> containing multiple lists"), the function seems to have some problems.
>
> Given a slight modification of the examples in help(split):
>
> > xg <- split(x,list(g1=g,g2=g))
> > unsplit(xg,list(g1=g,g2=g))
> [1] -0.7877109
2004 Dec 09
3
US 2004 Elections map
even for people who didn't like the outcome of the US elections this
year, it must have been a joy to see all the nice (and not so nice)
graphs that were shown. As an exercise, I recreated the map shown on
the NY-Times website [
http://www.nytimes.com/packages/khtml/2004/11/03/politics/
20041103_px_ELECT_GRAPHIC.html ]
If you're interested,
1999 Jan 11
0
Bug in axis(...,tcl=0)?
Hi,
first of all, I would like to take this opportunity to thank all of you
"answer guys" for giving such detailed answers. I think I've learned about
as much from all these answers as from the different S/R documents I've
read so far.
Anyway, I ran into a incompatability between S and R, that is, R does not
know the "ticks=T/F" argument to functions like axis and
2001 Feb 23
0
Prevent killing an ESS *R* buffer unintentionally
A couple of days ago I posted some elisp code that asks the user for
confirmation before deleting a process buffer, e.g. the *R* buffer. However,
this code was only evaluated if a buffer was killed by means of [C-x k]. The
following code does not need to be bound to a particular key, it's
internally called by kill-buffer. (Also works if buffer is deleted in other
ways, e.g., [C-x C-c].)
2003 Aug 10
1
read.spss doesn't work anymore
A couple of months ago, probably using an older version of R, R used to
run the following code just fine:
library("foreign")
data.exp1 <- as.data.frame(read.spss("dataDef.sav"))
Issuing the same commands now (after starting R using --vanilla), gives
me the following behavior:
> library("foreign")
> x <- read.spss("dataDef.sav")
Error
2000 Jul 28
2
Loop removal?
Dear all,
I've got a quite large dataframe (stor) with rows subject and rt (reaction
time). I would like to split the reaction times per subject into 6 bins of
equal size. Right now, I'm using the following code:
bindata <- function(rt) {
bindata <- rep(-1,length(rt))
binwidth <- length(rt)/6
bindata[order(rt)[(0*binwidth)+1:(1*binwidth)]] <- 1
2002 Dec 20
3
Sweave & xtable
I'm trying to get Sweave running for automatic report generation, and
it seems to run fine when just using verbatim output. However, I've ran
into a problem with xtable. I would like to print the following matrix
using xtable:
> dim(counts)
[1] 19 15
All columns are filled with real/integer numbers > 0 and < 1000. Just
typing xtable(counts) gives correct LaTeX output, but
2001 Mar 07
4
R.xpm?
I use AfterStep on Linux. I made an R.xpm file (attached)
and put this icon in the "wharf". To invoke R I click on the R icon.
I did not find an offical R.xpm, and so I am submitting this one
for your collective consideration....
The idea behind the icon is that it looks like a scatterplot, which is
"statistical". My main beefs with my R.xpm are that it doesn't have a
2005 Oct 07
1
sscanf equivalent
I have a data file from which I need to read portions of
data but data location/quantity can change from file to file.
I wrote some code and have a working solution but it seems
wasteful to have to do it this way. Here's the contrived
incomplete code.
datalines <- readLines(datafile.pathname)
# marker will appear on line preceding and following
# actual data
offset.data
2002 Jul 28
0
[R] bug in unsplit()? (PR#1845)
Hedderik van Rijn <hedderik@cmu.edu> writes:
> > Thanks for pointing this out. I think your code should work, although
> > I'm slightly uneasy about actually modifying f, so how about
>
> Just curious, why are you uneasy about that? Does it have side effects?
It is largely due superstition, but if you change f before calling
split<-() you have split() and
2006 Jul 18
1
SpeexEncoder requires 320 samples to process a Frame, not 160
Hi guys
I have tried compiling this attached code, I made all the buffers 320, there is no trace of a 160 buffer, but I get a "
SpeexEncoder requires 320 samples to process a Frame, not 160" error.
Maybe there's something I'm missing, here's my code:
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.File;
import
2009 Mar 02
2
[Fwd: RE: Mixing inputstreams.]
Thanks Ross,
So you think that I can just numerically add up the appropriate Bytes
from each of the streams? If that's so would we be better add first,
then to normalise after the additon, so the final byte size is the same
as the individual ones, what ever that may be.
-------- Original Message --------
Subject: RE: [Vorbis] Mixing inputstreams.
Date: Tue, 3 Mar 2009 01:12:35 +1300
2009 Sep 02
3
PRoblem with paste function
I am having trouble with paste function. I dont know how to proceed. I tried
many options but i failed miserably.
I am using a variable f1 to assign a string as below:
f1=dataLine[locAffyProbeID];
( the value of f1 is 244901_at )
Then I am using the paste function
paste("set @g1=", f1);
instead of getting set at g1=244901_at, I am getting set @g1=23.
I am not able to understand
2001 Feb 15
1
Re: Question "kill-buffer"
I would be very thankfull for such a solution, too ....
"R.E. Darnell" wrote:
>
> Would introducing a "Are you sure?" question after kill the *R* ( or
> whatever) buffer with a hasty C-x k be a popular default
> "feature". How can I include this for my own use?
>
> Thanks
>
> Ross Darnell
--
2003 Jan 20
2
ave across columns
Hi:
How do I find average across three columns such as weight1, weight2,
weight3 (20 people, each person has three different measures)? They have
NA's also. Thanks
Tom, Univ of Pittsburgh, ttrut at yahoo.com
2008 May 09
2
K-Means Clustering
Hello,
I am hoping you can help me with a question concerning kmeans clustering
in R. I am working with the following data-set (abbreviated):
BMW Ford Infiniti Jeep Lexus Chrysler Mercedes Saab Porsche
Volvo
[1,] 6 8 2 8 4 5 4 4 7 7
[2,] 8 7 4 6 4 1 6 7 8 5
[3,] 8 2 4
2004 Aug 06
2
q about jspeex
Ulrich B. Staudinger wrote:
> Hi,
>
> i have:
>
> public void run(){
> try{
> System.out.println("Opening
> mic"); // AudioInput
> ai=new AudioInput(t);
> // ai.start();
> if(t.input==null){
> AudioFormat format = new
1998 Jun 18
0
R-beta: netscape/R interaction [color allocation]
Thanks to Martin Maechler, Douglas Bates, Peter Dalgaard, and Hedderik van Rijn
for pointing out the problem is with the color resource demands of the two
applications and for their suggested possible solutions. A 24 bit monitor would
be ideal and maybe someday I'll have the $$$ to upgrade. "netscape -install"
works with the attendant flashing screen color changes from window to