similar to: understanding loops for "loop-plotting"

Displaying 20 results from an estimated 1000 matches similar to: "understanding loops for "loop-plotting""

2010 Sep 23
2
dnorm
Dear R-users Idea: Plot a dnorm line using specific mean/sd to complete a histogram (skewed). xs:range of y-values, ys: dnorm function Problem: I expected to multiply the ys function with the sample size (n=250-300). I was wondering about a factor between 12'000 and 30'000 to match the size of the dnorm line with the specific histogram. Thanks Sibylle hist(Biotree[Ld,]$Height2008,
2011 Dec 09
1
apply on function with vector as result
Hi, a have some code like myfunc <- function(x) { ...; return c(a,b) } ys <- sapply(0:100,myfunc) so I get something like c(c(a1,b1),c(a2,b2),...) But now I need the "as" and "bs" in one vector as <- apply(ys, function(c(a,b)) a) bs <- apply(ys, function(c(a,b)) b) Can you help me with the correct syntax, instead of my pseudo code? thx Christof
2003 Aug 04
1
Novice question
Hello. I am new R user, so this question is probably quite stupid, but for the life of me I cannot figure out how to get predications using multivariate linear regression analysis. Single variable predictions work fine. I am trying the following: -- Known y's for known x's1 and x's2 ys <- c(133890, 135000, 135790, 137300, 138130, 139100, 139900, 141120, 141890, 143230, 144000,
2005 Oct 16
2
Animated lissajous
Here's some code to make lissajous dance. I've attached a small sample GIF. Cheers, Rob Steele robsteele at yahoo dot com plot.lissajous = function(omega.x, omega.y, delta = 0, num.thetas = 200) { thetas = seq(0, 2 * pi, length = num.thetas) xs = sin(omega.x * thetas + delta) ys = cos(omega.y * thetas) plot(xs, ys, type = 'l', lwd = 3, ann = FALSE, axes = FALSE) }
2023 May 20
1
[libguestfs-common PATCH] Add support for OCaml 5.0
Pervasives is deprecated since Ocaml 4.08 and has been removed in OCaml 5.0. https://github.com/ocaml/ocaml/pull/1605 --- mlstdutils/std_utils.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlstdutils/std_utils.ml b/mlstdutils/std_utils.ml index 0d2fa22..86b21a7 100644 --- a/mlstdutils/std_utils.ml +++ b/mlstdutils/std_utils.ml @@ -341,12 +341,12 @@ module List =
2012 Feb 06
1
ggplot2 geom_polygon fill
Hi everyone, i've been trying to make a special plot with ggplot2, but I can't get it to fill the polygon I'd like to see filled so very very much. I want to display the difference or change in the distribution of the modified Rankin Scale between two groups. mRS is a scale for disability or daily activities competence. It looks like this.
2011 Nov 04
3
barplot as histogram
Hello: I'm dealing with an issue currently that I'm not sure the best way to approach. I've got a very large (10G+) dataset that I'm trying to create a histogram for. I don't seem to be able to use hist directly as I can not create an R vector of size greater than 2.2G. I considered condensing the data previous to loading it into R and just plotting the frequencies as a
2008 Jan 22
2
contingency table on data frame
I am sorry if this is a faq or tutorial somewhere, but I am unable to solve this one. What I am looking for is a count of how many different categories(numbers in this case) that appears for a given factor. Example: > l <- c("Yes", "No", "Perhaps") > x <- factor( sample(l, 10, replace=T), levels=l ) > m <- c(1:5) > y <- factor( sample(m, 10,
2006 May 08
1
ob.step$anova interpretation
hello I built logistic regression model. To model check I used stepAIC. But I don't know how it is interpreted . I could not any find any explanation about it For instance which model is preferable ? What are the critarias to choose beter model I will appreciate if you give me an explanation ? models --------- > lo1.step$anova Stepwise Model Path Analysis of Deviance Table Initial
2011 Oct 24
1
using predict.lm() within a function
I've written a simple function to draw a regression line in a plot and annotate the line showing the slope with a label. It works, as I'm using it, when the horizontal variable is 'x', but gives incorrect results otherwise. What's wrong? # simple function to show the slope of a line show.beta <- function(model, x="x", x1, x2, label, col="black", ...)
2002 Jan 05
1
abline and log plots (PR#1243)
Full_Name: Stephen Eglen Version: 1.4 OS: Redhat Linux 7.1 Submission from: (NULL) (128.252.204.36) abline() produces a spurious line in addition to the correct line, at least with the X11 driver. The postscript file generated also has nan values in it, which causes an error under ghostscript. xs <- c(0, 150, 300) ys <- c(75, 40, 23) par(mfrow=c(1,2)) plot(xs,ys, log="")
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
Dear R-List users, Can anyone explain exactly the difference between Weights options in lm glm and gls? I try the following codes, but the results are different. > lm1 Call: lm(formula = y ~ x) Coefficients: (Intercept) x 0.1183 7.3075 > lm2 Call: lm(formula = y ~ x, weights = W) Coefficients: (Intercept) x 0.04193 7.30660 > lm3 Call:
2013 Apr 19
1
How to select the scale parameter for Gabor transform (Rwave)?
Dear list, I am trying to choose the scale parameter for the cgt transform but I don't know how to do it. In time I would like to be able to separate points 30 samples apart, and in frequency I would like to separate bands 0.04 Hz apart. I tried the two approaches described below and they gave me different results. I would appreciate advise on how to do this. The Rwave Gabor transform uses
2016 Jul 07
2
Re: [PATCH v3 4/8] mllib: Add some imperative list manipulation functions.
On Thursday 07 July 2016 17:30:03 Richard W.M. Jones wrote: > This adds imperative list manipulation functions inspired by Perl. > The functions are passed list refs which get updated in place. > > This allows us to replace some awkward pure functional code like: > > let xs = ys in > let xs = if foo then xs @ zs else xs in > > with: > > let xs = ref ys in
2016 Jul 08
2
Re: [PATCH v3 4/8] mllib: Add some imperative list manipulation functions.
On Thu, Jul 07, 2016 at 06:08:43PM +0100, Richard W.M. Jones wrote: > On Thu, Jul 07, 2016 at 07:00:46PM +0200, Pino Toscano wrote: > > On Thursday 07 July 2016 17:30:03 Richard W.M. Jones wrote: > > > This adds imperative list manipulation functions inspired by Perl. > > > The functions are passed list refs which get updated in place. > > > > > > This
2007 Oct 13
2
How to identify the two largest peaks in a trimodal distribution
Hello all I'm trying to do a simulation that involves identifying the minimum point between two peaks of a (usually) bimodal distribution. I can do this easily if there are only two peaks: CnBdens<-density(Ys/Xs) #probability density function for ratio of Ys to Xs for(p in 1:512) ifelse(CnBdens$y[p]>CnBdens$y[p-1],peak1<-p,break) #identifies first peak in probability
2013 Mar 04
2
R function for estimating historical-VaR
Hi everyone!! I am new in R and I want to create a simple R function for estimating historical-VaR. In y_IBM returns, there are 2300 observations. For evaluation I take the next 2000 observations, then I abandon the latest 300 observations. Firstly, I use the window which has the fix length and contains the observations from 1 to 2000 to estimate the VaR. At first I take 2000 obs. and reorder
2008 May 08
1
[LLVMdev] Vector code
Nicolas Capens wrote: > Here's essentially what I try to generate: > > void add(float z[4], float x[4], float y[4]) > { > z[0] = x[0] + y[0]; > z[1] = x[1] + y[1]; > z[2] = x[2] + y[2]; > z[3] = x[3] + y[3]; > } This is the vectorized llvm-assembly equivalent: ----- define void @add(<4 x float>* %z, <4 x float>* %x, <4 x float>* %y) {
2009 Aug 19
1
ridge regression
Dear all, I considered an ordinary ridge regression problem. I followed three different ways: 1. estimate beta without any standardization 2. estimate standardized beta (standardizing X and y) and then again convert back 3. estimate beta using lm.ridge() function X<-matrix(c(1,2,9,3,2,4,7,2,3,5,9,1),4,3) y<-t(as.matrix(cbind(2,3,4,5))) n<-nrow(X) p<-ncol(X) #Without
2005 Aug 18
2
lme model: Error in MEEM
Hi, We have data of two groups of subjects: 32 elderly, 14 young adults. for each subject we have 15 observations, each observation consisting of a reaction-time measure (RT) and an activation maesure (betadlpcv). since we want to analyze the influence of (age-)group and RT on the activation, we call: lme(betadlpcv ~ RT*group, data=our.data, random=~ RT |subject) this yields: Error in