similar to: repeating a function across a data frame

Displaying 20 results from an estimated 160 matches similar to: "repeating a function across a data frame"

2012 Nov 24
6
IMPORTANT!!!! PLEASE HELP ME
Hi, I want to generate 10000 samples from normal distribution with replacement case and every sample size is 50. What should I do ? -- View this message in context: http://r.789695.n4.nabble.com/IMPORTANT-PLEASE-HELP-ME-tp4650676.html Sent from the R help mailing list archive at Nabble.com.
2009 May 13
2
Problems with randomly generating samples
Dear R users, Can anyone please tell me how to generate a large number of samples in R, given certain distribution and size. For example, if I want to generate 1000 samples of size n=100, with a N(0,1) distribution, how should I proceed? (Since I dont want to do "rnorm(100,0,1)" in R for 1000 times) Thanks for help Debbie
2009 May 21
1
Need help on ploting Histograms
this is the command i made for a normal distribution, but when i try to plot the histograms, i dont know why the bars don't stick on the line... nsamples<-1000 sampsize<-15 Samples<-matrix(rnorm(nsamples*sampsize,0,1),nrow=nsamples) a<-apply(Samples,1,var) NC14<-a*14 x<-0:40 plot(x,dchisq(x,14),type='h') hist(NC14,freq=F,add=T) -- View this message in context:
2011 Feb 03
1
problem with parLapply from snow
Hi, The following function use to work, but now it doesn't giving the error "> CallSnow(, 100) Using snow package, asking for 2 nodes 2 slaves are spawned successfully. 0 failed. Error in checkForRemoteErrors(val) : 2 nodes produced errors; first error: no applicable method for 'lapply' applied to an object of class "list" ". Where this is the
2010 Nov 15
5
Sampling problem
Hey, I am hoping someone can help me with a sampling question. I have a data frame of 8 variables (the first column is the subjects' id): SubID CSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4 1 6 5 6 2 6 2 2 4 2 6 4 7 2 6 6 2 3 3 5 5 5 5 5 5
2011 Jan 04
1
Resampling to find Confidence intervals
Hi, I'm doing some modelling (lm) for my 3rd year dissertation and I want to do some resampling, especially as I'm working with microbes, getting them to evolve resistance to antimicrobial compounds, and after each exposure I'm measuring the minimum concentration required to kill them (which I'm expecting to rise over time, or exposures), I have 5 lineages per cleaner, and
2006 Sep 16
3
converting 16-bit samples in LPSTR to short
Hi, I am capturing 16 bit mono sound samples using some Win32 API function calls. These function calls return the sound samples in an array of characters. My assumption is that this array of characters represents pairs of bytes that make up a short integer. I'm using the following code to convert the samples: LPTSTR *lpSaveBuffer; ...... for(j=0;j<nBytes;++J) { BYTE a =
2008 Nov 14
3
SPEEX on iPhone ?
----- Original Message ----- From: "Alexander Chemeris" <Alexander.Chemeris at sipez.com> To: "Vincent Burel" <vincent.burel at vb-audio.com> Cc: "Conrad Parker" <conrad at metadecks.org>; <speex-dev at xiph.org>; "Jean-Marc Valin" <jean-marc.valin at usherbrooke.ca> Sent: Thursday, November 13, 2008 11:31 PM Subject: Re:
2005 Jun 04
2
[PATCH] line endings fix
The replay gain code has dos line endings in CVS, which causes problems for the Sun compiler, among others. Attached is a patch for the lazy, but it's probably easier to fix locally and commit. -r
2010 Jan 25
3
binary
Hi all Assume I have a data set xx; Group: 1=group1 ?, 2=group2 IQ: ?1= High, 0 =low fit <- glm(IQ ~group, data = xx, family = binomial()) summary(fit) Results ?????? ????????????Estimate Std. Error z value Pr(>|z|) (Intercept) -2.55456??? 0.210 -12.273? < 5e-16 *** group????????? 0.36180 ?????0.076?? 3.952 ????5.24e-05 *** the odd ratio = exp(0.36180 )= 1.435912 My question
2005 Nov 23
5
finding peaks in a simple dataset with R
I've been asked in private, (and am replying BCC to the asker), >> I saw your post on the R-help archives page about the possibility of >> porting a function from S-Plus called peaks() to R. I am looking for >> some way to locate peaks in a simple x,y data set, and thought that R >> might be the way to go. "of course" it is the way to go, don't get
2007 Dec 04
2
[PATCH] Add Visual Studio 2008 Prject files
On Dec 3, 2007 1:24 PM, Stefan Reuther <streu@gmx.de> wrote: > John Miles wrote: > > What's wrong with a plain old .bat file, or even an NMAKE .mak file? > > Ship two files, debug.bat and release.bat, and call it good. > > > > It is best to leave project-file creation up to individual users, > > in my opinion. > > I second that. When I played around
2004 Feb 13
10
Encoding into MONO (delphi)
Hi! I have a problem. I hope, you can help me. I use a Delphi conversion (from Aleksandr Shamray), but it doesn't work when I'd like to convert a *.RAW into a mono *.ogg file. vorbis_encode_init_vbr(vi, 1, 44100, 0.5); //because of the mono the program stops at line: //* uninterleave samples */ . . buffer[1][i] := smallInt((pArray(@readbuffer)[i shl 2 + 3] shl 8) or
2008 Oct 22
2
Help with functions
Hi there, I have a the following function which takes a name(fname), total number of rows (Total), number of times to make a sample(nSample), number of records/rows to be included in each sample(nPatient). then it generates required samples and calculates the mean and standard deviation of the columns for each sample and finally in calculates the grand mean and standard deviation. The problem
2012 Mar 16
2
Elegant Code
Hi, Can anyone help to write a more elegant version of my code? I am sure this can be put into a loop but I am having trouble creating the objects b1,b2,b3,...,etc. b1 <- rigamma(50,1,1) theta1 <- rgamma(50,0.5,(1/b1)) sim1 <- rpois(50,theta1) b2 <- rigamma(50,1,1) theta2 <- rgamma(50,0.5,(1/b2)) sim2 <- rpois(50,theta2) b3 <- rigamma(50,1,1) theta3 <-
2004 Oct 29
1
fitting linear mixed model for incomplete block design
Dear R developers and users: I have the following data, x is the response vaiable, nsample(individual) nested within trt, and subsample nested within nsample, I want to fit trt as fixed effect, and block, nsample(trt) as random effects using lme, is the following coding correct? dat$vgrp <- getGroups(dat, form = ~ 1|trt/nsample, level = 2) ge.lme1 <- lme(fixed=x~trt, data=dat,
2007 Dec 19
0
leaps
Thank you very much for the example. I think interactively I could get something. But my obstacle is to write an R script that processes my set of data automatically. My difficulty is to extract the information that appears on the screen, when R is operated interactively, from a scripts. Let me go over some steps to make sure I am doing things right. Assume my data have been read into the matrix
2009 Feb 24
0
any help with pyogg and pyvorbis?
Dear List, I'm just creating a little application for my openmoko freerunner, unfortunately in python, so that I have to use pyogg and pyvorbis(http://ekyo.nerim.net/software/pyogg/index.html) as wrappers around the C-functions and objects. I've got it all installed, after applying some patches and trying to run an example of encoding a wave-file I just get an empty ogg-file, the
2001 Jul 24
0
bug in residuals.rpart?
The following code tr <- rpart(Y ~ ., dat, method="class") dev <- residuals(tr, "deviance") produces the following error Error in log(x) : Non-numeric argument to mathematical function > .Traceback [[1]] [1] "log(yhat)" # line 588 of rpart [[2]] [1] "switch(type, usual = as.integer(y != yhat), pearson = (1 - yhat)/yhat, " [2] "
2001 Jul 20
1
frames and formulas
I can build a tree at the command line using tr <- tree(V4 ~ ., dat) but I don't know how to build one inside a function - the following does not work foo <- function(dummy) { tr <- tree(V4 ~ ., dummy) } tr2 <- foo(dat) and produces the error Error in model.frame.default(formula = V4 ~ ., data = dummy) : Object "dummy" not found I know the solution has