Displaying 20 results from an estimated 193 matches for "ys".
Did you mean:
sys
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, main="Larix decidu...
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
C...
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, 145290)
xs1 <- c(1:12)
xs2 <- c(22, 24.5, 27, 33, 36.8, 40, 44, 57, 59, 6...
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)
}
## Show one.
par(mar = c(2, 2, 2, 2))
plot.lissajous(4, 3)
## Animate it.
while (TRUE) {
for (delta in seq(0, 2 * pi, length = 120)) {
plot.lissajous(4, 3, delta)
Sys.sleep(1 / 30)...
2011 Nov 04
3
barplot as histogram
...reate 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 barplot; unfortunately, barplot does not support
plotting the values according to a set of x-axis positions.
What I have is something similar to:
ys <- c(12,3,7,22,10)
xs <- c(1,30,35,39,60)
and I'd like the bars (ys) to appear at the positions described by xs. I
can get this to work on smaller sets by filling zero values in for
missing ys for the entire range of xs but in my case this would again
create a vector too large for R....
2008 Jan 22
2
contingency table on data frame
..."X" = x)
> my_df
Z Y X
1 1 4 Yes
2 2 1 No
3 3 2 Perhaps
4 4 3 Yes
5 5 4 No
6 6 5 No
7 7 1 Yes
8 8 4 Perhaps
9 9 4 Yes
10 10 2 Perhaps
>
I am now looking for a table that will give me this:
Yes 3 # Yes has these ys: 4,3,1,4, two are the same, ergo 3
No 3 # No has these ys: 1,4,5
Perhaps 2 # Perhaps has these ys: 2,4,2
My dataframe has lots of other colums too, but I only want this
information out.
Thankyou for your help!
Karin
--
Karin Lagesen, PhD student
karin.lagesen at medisin.uio....
2012 Jul 02
0
Fit circle with R
.../www.mathworks.com/matlabcentral/fileexchange/22643-circle-fit-pratt-method/content/CircleFitByPratt.m,
based on:
*V. Pratt, "Direct least-squares fitting of algebraic surfaces", Computer
Graphics, Vol. 21, pages 145-152 (1987)*
I am looking for new methods to compare and improve my analysis because
the error increase with decreasing of points used in the functions.
Thanks for all suggestions
Gianni
Here the funtions with example
# fitCircle, returns:
# xf,yf = centre of the fitted circle
# Rf = radius of the fitted circle
# Cf = circumference of the fitted circle
# Af = Area of...
2023 May 20
1
[libguestfs-common PATCH] Add support for OCaml 5.0
...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 = struct
| x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs
| _ -> invalid_arg "combine3"
- let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function
+ let rec assoc_lbl ?(cmp = Stdlib.compare) ~default x = function
| [] -> default
| (y, y') :: _ when cmp...
2012 Feb 06
1
ggplot2 geom_polygon fill
...en the bars would fill in the same colors
as the bar segments do.
Interestingly, in the example provided by the geom_polygon help page, there
is a fill, which leads me to suspect that something with my data frame might
be wrong.
If I supply a "colour" argument, I get borders, but not always in the color
I defined. The attached image has such borders, to make clear what polygons
I am talking about. In the final plot I don't desire such borders, only the
as of yet unattainable fill.
Here's my code:
library(ggplot2)
library(plyr)
# define good looks
no_margins <- opts(...
2011 Oct 24
1
using predict.lm() within a function
...hat's wrong?
# simple function to show the slope of a line
show.beta <- function(model, x="x", x1, x2, label, col="black", ...) {
abline(model, col=col, lwd=2)
# x <- deparse(substitute(x)) # doesn't help
xs <- data.frame(x=c(x1, x2, x2))
ys <- predict(model, xs)
lines(cbind(xs,ys[c(1,1,2)]), col=col)
text(x2, mean(ys[1:2]), label, col=col, ...)
}
x=rnorm(10)
DF <- data.frame(x, y=.25*x+rnorm(10))
# OK
with(DF, {
plot(y ~ x)
mod <- lm(y ~ x)
show.beta(mod, "x", -0.5, 0, "b", pos=4...
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
...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:
lm(formula = ys ~ Xs - 1)
Coefficients:
Xs Xsx
0.04193 7.30660
Here ys= y*sqrt(W), Xs<- sqrt(W)*cbind(1,x)
So we can see weights here for lm means the scale for X and y.
But for glm and gls I try
> glm1
Call: glm(formula = y ~ x)
Coefficients:
(Intercept) x
0.1183 7.3...
2006 May 08
1
ob.step$anova interpretation
...tepAIC. 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 Model:
res ~ as.factor(jeo) + as.factor(eg) + as.factor(ys) + as.factor(yy) +
as.factor(ak)
Final Model:
res ~ as.factor(jeo) + as.factor(eg) + as.factor(ys) + as.factor(yy) +
as.factor(ak)
Step Df Deviance Resid. Df Resid. Dev AIC
1...
2002 Jun 20
16
problem with predict()
...")
x.scale <- attr(xr, "scaled:scale")
mask <- apply(xr, 2, function(x) any(is.na(x)))
xr <- xr[,!mask] # rm NA's
model <- lm(yr ~ xr) # fit linear model
test <- read.csv("test.csv", header = TRUE, row.names = "mol",
comment.char="")
ys <- test[,1]
xs <- test[,-1]
xs <- scale(xs, center = x.center, scale = x.scale)
xs <- xs[,!mask]
xs <- as.data.frame(xs)
pr <- predict(model, as.data.frame(xr))
ps <- predict(model, xs)
cat("length(yr) =", length(yr), "; length(pr) =", length(pr),"\n&...
2002 Jan 05
1
abline and log plots (PR#1243)
...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="")
abline(70, -0.25, -.1, untf=F)
plot(xs,ys, log="y")
abline(70, -0.3, -.1, untf=T)
dev.copy2eps(file="abline.ps")
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing...
2018 Mar 07
0
ggplot2: plot gruped/nested split violins
...ggplot2:::ggname("geom_split_violin",
GeomPolygon$draw_panel(newdata, ...))
}
})
create_quantile_segment_frame <- function (data, draw_quantiles, split
= FALSE, grp = NULL) {
dens <- cumsum(data$density)/sum(data$density)
ecdf <- stats::approxfun(dens, data$y)
ys <- ecdf(draw_quantiles)
violin.xminvs <- (stats::approxfun(data$y, data$xminv))(ys)
violin.xmaxvs <- (stats::approxfun(data$y, data$xmaxv))(ys)
violin.xs <- (stats::approxfun(data$y, data$x))(ys)
if (grp %% 2 == 0) {
data.frame(x = ggplot2:::interleave(violin.xs, violin.xmax...
2013 Apr 19
1
How to select the scale parameter for Gabor transform (Rwave)?
...nProblem/gtResultSigma10.jpg.
fromTime <- 0
toTime <- 250
by <- 1
ts <- seq(from=fromTime, to=toTime)
f1 <- 0.01
f2 <- 0.05
t1 <- 50
t2 <- 80
K <- 15
fMax <- 0.20
nf <- 100
df <- fMax/(nf/2)
scale <- 10
ys <- sin(2*pi*f1*ts) + sin(2*pi*f2*ts)
ys[t1] <- K
ys[t2] <- K
plot(x=ts, y=ys, xlab="Time", ylab="Signal", type="b")
cgtsinwave <- cgt(input=ys, nvoice=nf, freqstep=df, scale=scale, plot=TRUE)
Many thanks, Joaquin
--
Joaquin Rapela, PhD
S...
2005 Mar 30
0
B‮ alcra‬ ys Ema‮ li‬ Veri‮ noitacif‬
D#8238;ae#8236;r B#8238;ra#8236;clays M#8238;rebme#8236;,
T#8238;ih#8236;s em#8238;lia#8236; was se#8238;tn#8236; by the Barc#8238;al#8236;ys s#8238;re#8236;ver to veri#8238;yf#8236; y#8238;ruo#8236; e#8238;liam#8236; add#8238;ser#8236;s. You m#8238;tsu#8236; c#8238;etelpmo#8236; t#8238;sih#8236; proc#8238;se#8236;s by c#8238;kci...
2004 Feb 16
1
understanding loops for "loop-plotting"
...pdf the 5 plots . So i want plots for const=1:5 which change the undelying
data expressed in t1 and t2.
I attempt some trials , while, for and now
repeat loop now , but didn't getting success . I get only the first plot and
the loop hang?
Many thanks for help ,Christian.
#modeldat and YS are data.frames.
special <- function(const,modeldat,YS) {
const=const
repeat {
t1 <- apply(YS,1, function(x) { ifelse(all(is.na(x)) | all(na.omit(x) <
0 ,NA, which( x > const ))})
t1[is.na(t1)] <- 13
t2 <- sapply(t1,function(x) { ifelse(x ==13,0,1)})
modeldat$MONTH &l...
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
> if foo then append xs zs;
> ---
TBH I've always found the "shift" and "unshift" naming of Perl
functions slightly awkward, but can live with them. (At least the
new...
2003 Jul 01
0
RE: question about spatial correlation with Xs and Ys
-----Original Message-----
From: r-help-request at stat.math.ethz.ch
[mailto:r-help-request at stat.math.ethz.ch]
Sent: Tuesday, July 01, 2003 3:09 AM
To: r-help at stat.math.ethz.ch
Subject: R-help Digest, Vol 5, Issue 1
At 18:48 30/06/2003, Martin Wegmann wrote:
>hello,
>
>I want to do a test for spatial correlation.
>I tried it with geary.test() but I don't understand the