search for: samp

Displaying 20 results from an estimated 213 matches for "samp".

Did you mean: same
2004 Mar 01
6
How to plot Histogram with frequence overlaid by distribution curve
Hi, I am facing the problem that I want to plot a histogram chart set freq to true and overlay with normal or weibull or exponential distribution curve. The sample code is shown as below: >samp<-c(-8.2262,-8.2262,-8.2262,-8.20209,-8.09294,-8.07321,-8.07321, -8.07321,-8.07175,-8.04948,-8.04948,-8.04948,-8.03848,-8.03848, -8.026,-7.92517,-7.92517,-7.77218,-7.62414,-7.62414,-7.62414, -7.59027,-7.59027,-7.59027,-7.59027,-7.59027,-7...
2011 Mar 17
3
Beginner question: How to replace part of a filename in read.csv?
I would like to use samp as a part of a filename that I can change. My source files are .csv files with date as the file name, and I would like to be able to type in the date (later perhaps automate this using list.files) and then read the csv and write the pdf automatically. I have tried different combinations with "...
2007 Apr 19
0
minor omissions re "special" windows file names (PR#9622)
...ep(/^(con|prn|aux|clock\$|nul|lpt[1-3]|com[1-4])$/, NEW LINE: if(grep(/^(con|prn|aux|clock\$|nul|lpt[1-9]|com[1-9])$/, ALSO: fix comment at beginning of check.in (search for "com1") In doc/manuals/R-exts.texi, I would suggest changing ----- names. In addition, files with names @samp{con}, @samp{prn}, @samp{aux}, @samp{clock$}, @samp{nul}, @samp{com1} to @samp{com4}, and @samp{lpt1} to @samp{lpt3} after conversion to lower case and stripping possible ``extensions'', are disallowed. Also, file names in the same ----- to ----- names. In addition, files with names @samp{...
2012 Sep 20
3
lattice dotplot reorder contiguous levels
..., conc = c(2.32, 0.902, 0.468, 5.51, 1.49, 0.532, 0.72, 0.956, 0.887, 20, 30, 2.12, 0.442, 10, 50, 110, 3.36, 2.41, 20, 70, 3610, 100, 4.79, 20, 0.0315, 30, 60, 1, 3.37, 80, 1.21, 0.302, 0.728, 1.29, 30, 40, 90, 30, 0.697, 6.25, 0.576, 0.335, 20, 10, 620, 40, 9.98, 4.76, 2.61, 3.39, 20, 4.59), samp.time = structure(c(2L, 4L, 4L, 4L, 4L, 4L, 5L, 4L, 8L, 8L, 8L, 8L, 8L, 9L, 8L, 7L, 8L, 8L, 8L, 8L, 3L, 3L, 2L, 4L, 4L, 4L, 4L, 4L, 1L, 4L, 6L, 4L, 8L, 4L, 8L, 4L, 3L, 8L, 4L, 8L, 4L, 8L, 4L, 9L, 3L, 8L, 8L, 8L, 8L, 8L, 8L, 1L), .Label = c("2", "4", "12", "24&q...
2011 Sep 06
2
Generalizing call to function
...23922306948) Thanks in advance. func1 <- function(y, a, rate) { f1 <- function(n, y, a, rate) { lambda <- a * n dexp(n, rate) * dpois(y, lambda) } integrate(f1, 0, Inf, y, a, rate) } func1(1, 0.1, 0.1) func2 <- function(y, a, rate, samp) { f1 <- function(n, y, a, rate, samp) { SampDist <- function(y, a, n, samp) { lambda <- a * n dcom <- paste("d", samp, sep="") dots <- as.list(c(y, lambda))...
2003 Apr 08
3
density ranges for uniform law
Hello, I would have some details and explanations about the results I get. In fact, I start with a uniform sample between -1 and 1, and then plot its density. My problem is that the density ranges are much more longer than I expected : samp <- runif(10000,-1,1) plot(density(samp)) Instead of varying between -1 and 1, the density varies between approximaly -1.5 and 1.5 Could someone explain me what is ha...
2009 Feb 24
2
lmer, estimation of p-values and mcmcsamp
...estimates on these and other help threads: https://stat.ethz.ch/pipermail/r-help/2006-May/094765.html http://pidgin.ucsd.edu/pipermail/r-lang/2007-August/000057.html but have not yet been successful. This is my code: lnmass <- lmer(log.mass ~ treatment + (1|block), data=exp1) summary(lnmass) samp <- rnorm(n=10000) mcmcpvalue <- function(samp) {std <- backsolve(chol(var(samp)), cbind(0,t(samp)) - colMeans(samp), transpose = TRUE) sqdist <- colSums(std*std) sum(sqdist[-1] > sqdist[1]/nrow(samp) } markov1 <- mcmcsamp(lnmass, 10000) HPDinter...
2000 Feb 24
2
(-1 as index) OR (envelope for QQ)
...S (Venables+Ripley, 3rd edition), to draw an envelope on a QQ plot. Copying from the book, I've got: #... code whose gist is "a.fit <- nls(..." num.points <- length(resid(a.fit)) qqnorm(residuals(a.fit)) # illustrate data-model residuals qqline(residuals(a.fit)) samp <- cbind(residuals(a.fit), matrix(rnorm(num.points*19),num.points,19)) samp <- apply(scale(samp), 2, sort) rs <- samp[,1] xs <- qqnorm(rs, plot=FALSE)$x env <- t(apply(samp[,-1], 1, range)) ###########################3 xyul <- par("usr") smidge <- min(di...
2017 Nov 12
2
create waveform sawtooth
...requencies result in longer waves. But that?s not all: as frequencies increase, it appears that wavelengths increase to infinite length, then get shorter again as the wave reverses, then it gets longer and flips again. Here?s a small file that demonstrates the bad sawtooth waves: library(tuneR) sample_rate <- 12000 reverse <- FALSE mycolors=c("red","orange","yellow","green","cyan","blue","violet","magenta") plot(sawtooth(110,duration=round(sample_rate/100),samp.rate=sample_rate,xunit="samples")@left...
2007 Mar 12
2
Lmer Mcmc Summary and p values
Dear R users I am trying to obtain p-values for (quasi)poisson lmer models, including Markov-chain Monte Carlo sampling and the command summary. > > My problems is that p values derived from both these methods are totally different. My question is (1) there a bug in my code and > (2) How can I proceed, left with these uncertainties in the estimations of > the p-values? > > Below is the corresp...
2004 Mar 09
2
maxima
Dear all, suppose I have a bi-variate function f(x,y), I want to find the maxima. I define x and y vector, and get matrix z=f(x,y). how can I get which (x0,y0) makes z become the maxima? I can do two loops to get the x0 and y0, but I think there may exist a function to do this.
2007 Feb 12
1
lmer and estimation of p-values: error with mcmcpvalue()
...s of parameters with just 1 d.f. (intercepts, slopes), so that the "mcmcpvalue" function defined below obviously produces error messages. How can I proceed in estimating the p-values, then? I very much acknowledge any suggestions. Best regards Christoph. ## mcmcpvalue <- function(samp) { std <- backsolve(chol(var(samp)), cbind(0, t(samp)) - colMeans(samp), transpose = TRUE) sqdist <- colSums(std * std) sum(sqdist[-1] > sqdist[1])/nrow(samp) } m1<-lmer(number_pollinators~logpatch+loghab+landscape_diversity+(1|site...
2017 Nov 12
0
create waveform sawtooth
Ccing the maintainer if the tuneR package. Looks to me like sawtooth (and square) don't behave as expected when using xunit="samples". Workaround is to use xunit="time" instead: sawtooth(110,duration=1/100,samp.rate=sample_rate,xunit="time") I looked at the code but found it to be opaque. -- Sent from my phone. Please excuse my brevity. On November 12, 2017 6:15:45 AM PST, Michael Tiemann <mdti...
2006 Jun 23
1
Problems creating packages.
...orials for how to create the package structure and the DESCRIPTION file ( http://web.maths.unsw.edu.au/~wand/webcpdg/rpack.html , http://www.maths.bris.ac.uk/~maman/computerstuff/Rhelp/Rpackages.html#Lin-Lin ). I'm still getting errors where when I try to load the library in R by using library(samp) I get an error: Error in library(samp) : 'samp' is not a valid package -- installed < 2.0.0? And when I use the library() call I get this: samp ** No title available (pre-2.0.0 install?) ** I'm not really sure where to go, I've looked throgh the huge docum...
2011 Mar 18
3
exploring dist()
Hello, everybody, I hope somebody could help me with a dist() function. I have a data frame of size 2*4087 (col*row), where col corresponds to the treatment and rows are species, values are Hellinger distances, I should reconstruct a distance matrix with a dist() function. I know that "euclidean" method should be used. When I type: dist(dframe,"euclidean") it gives me a
2011 Feb 10
3
Finding length of unique numbers in a vector
Hello there, would you please look into my codes? Here I have following: > set.seed(100) > samp <- sample(c(1,-1,0), 20, replace=T); samp [1] 1 1 -1 1 -1 -1 0 -1 -1 1 -1 0 1 -1 0 0 1 -1 -1 0 Here I want to calculate the length of each unique number for above vector. How can I do that? Thanks in advance [[alternative HTML version deleted]]
2007 May 02
2
how to reproduce the same sampled units?
Hi all, Is it possible to generate the same sample number of times in R? In SAS, using the option "seed" it is possible to reproduce exactly the same sample. Is there any such feature in R which I can use? For further clarity, for (i in 1:2) { samp = sample(1:1000,100,replace = FALSE) print(samp) } For the above simulation, is it...
2010 Sep 28
4
drawing samples based on a matching variable
Hi, everyone. I have what I hope will be a simple coding question. It seems this is a common job, but so far I've had trouble finding the answer in searches. I have two matrices (x and y) with a different number of observations in each. I need to draw a random sample without replacement of observations from x, and then, using a matching variable, draw a sample of equal size from y. It is the matching variable that is hanging me up. For example-- > # example matrices. lets assume seed always equals 1. (lets also assume I have assigned variable names A and...
2010 Jul 08
1
Time value not sorting properly
I have a dataframe of animal locations that I need to have in incremental order so that I can calculate the distance traveled between each time step. However, I have identified a few values that don't seem to sort properly. For instance, the last value in the table below should be the first value after sorting, since its time value is '00:01:35'. But, for some reason, it seems to be
2009 May 30
0
what is 'class.ind' here?
...asses" into test.cl (below) but I get an error of "(list) object cannot be coerced to type 'double'" my 'targets' vector was the last column of a matrix: targets=crs$dataset[,922] and so I tried to use targets=class.ind(targets) but still after: > test.cl(targets[-samp], predict(crsNNET1, crsNNET1[-samp])) I get: Error in as.vector(data) : (list) object cannot be coerced to type 'double' By the way, my samp vector is: samp <- c(sample(1:250,125), sample(251:500,125), sample(500:920,300)) Here is the example from nnet: data(iris3) # use half th...