Displaying 20 results from an estimated 5000 matches similar to: "warning in a loop"
2007 Jul 06
1
Multiple Stripcharts
Hi all,
I have 205 rows with measurements for three categories of people. I want to
generate stripplots for each of these rows. How can I do it without having
to do them one by one. I am giving a sample dataset:-
A
B
C
A
B
C
A
B
C
A
B
C
10.34822
10.18426
9.837874
9.65047
8.020482
9.17312
6.349595
13.55664
5.286697
11.85409
2.827027
7.002696
11.54984
12.14591
2007 Jul 13
1
how to create matrix in a loop
Hi all,
How does one create a matrix of values in a loop. For example, I have 46*70
matrix with columns giving the values for some blood tests performed upon
the 46 patients(rows). I want to perform a simple test of normality
(shapiro-wilk test) upon each of the biochemical tests for the 46
patients. Can somebody suggest the syntax for such a loop. For the data x, I
wrote the following loop which
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,
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 "" and () around samp, but I keep getting the error
"object
2012 Sep 20
3
lattice dotplot reorder contiguous levels
my reproducible example
test<-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L), .Label = c("A",
"B", "C", "D", "E"), class = "factor"),
2011 Sep 06
2
Generalizing call to function
Hello guys,
I would like to ask for help to understand what is going on in
"func2". My plan is to generalize "func1", so that are expected same
results in "func2" as in "func1". Executing "func1" returns...
0.25 with absolute error < 8.4e-05
But for "func2" I get...
Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
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
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.
2017 Nov 12
2
create waveform sawtooth
My tuneR sawtooth wave function generator is broken.
When I use the sine function, I get exactly what I expect: a sine wave whose frequency is defined by the freq parameter. In particular, higher frequencies have shorter wavelengths (more cycles per second means shorter waves). When I create a sawtooth wave, the opposite seems to occur: higher frequencies result in longer waves. But that?s not
2009 Feb 24
2
lmer, estimation of p-values and mcmcsamp
(To the list moderator: I just subscribed to the list. Apologies for not
having done so longer before trying to post.)
Hi all,
I am currently using lmer to analyze data from an experiment with a
single fixed factor (treatment, 6 levels) and a single random factor
(block). I've been trying to follow the online guidance for estimating
p-values for parameter estimates on these and other
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
2000 Feb 24
2
(-1 as index) OR (envelope for QQ)
I'm new to R (and to S) and am wondering about code from pages 72 and
83 of MASS (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 <-
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
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
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 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
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 possible to generate the same sampled
units
2003 Apr 15
5
Summarizing levels for future commands
Hi. This will hopefully be readily understood but if not, bear with me.
I have to do a repeated analysis (in spatstat) and want to batch file it. For each of my 'runs' certain variables change. At present I am manually specifying these changes and want to automate it if possible.
Ok, I am creating an object which is comprised of 'levels' that are 'characters'. Further
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
2011 Nov 02
3
how to count number of occurrences
Dear R users,
I have this data frame,
y samp
8 0.03060419 X
18 0.06120838 Y
10 0.23588374 X
3 0.32809965 X
1 0.36007100 X
7 0.36730571 X
20 0.47176748 Y
13 0.65619929 Y
11 0.72014201 Y
17 0.73461142 Y
6 0.76221313 X
2 0.77005691 X
4 0.92477243 X
9 0.93837591 X
5 0.98883581 X
16 1.52442626 Y
12 1.54011381 Y
14 1.84954487 Y