Displaying 20 results from an estimated 25 matches for "myy".
Did you mean:
may
2005 Jun 16
1
AIC in glm.fit with intercept
Dear R users,
glm.fit() gave me the same AIC's regardless of TRUE or FALSE intercept option.
> myX <- as.matrix(1:10)
> myY <- 3+5*myX
> foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=TRUE)
> foo$aic
[1] 38.94657
> foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=FALSE)
> foo$aic
[1] 38.94657
Is my code wrong or is it a b...
2012 Jul 02
0
Fit circle with R
...Rf
Af = pi*(Rf^2)
m <- cbind(xf,yf,Rf,Cf,Af)
return(m)}
# CircleFitByPratt, returns:
# [,1] and [,2] = centre of the fitted circle
# [,3] = radius of fitted cirlce
CircleFitByPratt <- function(x,y){
n <- length(x)
centroid <- cbind(mean(x),mean(y))
Mxx=0; Myy=0; Mxy=0; Mxz=0; Myz=0; Mzz=0;
for(i in 1:n){
Xi <- x[[i]] - centroid[1]
Yi <- y[[i]] - centroid[2]
Zi <- (Xi*Xi) + (Yi*Yi)
Mxy = Mxy + Xi*Yi;
Mxx = Mxx + Xi*Xi;
Myy = Myy + Yi*Yi;
Mxz = Mxz + Xi*Zi;
Myz = Myz + Yi*Zi;...
2007 Apr 18
5
Problem with ?curve
Dear all R gurus,
I have following syntax:
y = c(1:10)
chippy <- function(x)
{
y[5] = x
sin(cos(t(y)%*%y)*exp(-t(y)%*%y/2))
}
curve(chippy, 1, 20, n=200)
But I am getting error while executing :
Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' and 'y' lengths differ
In addition: Warning message:
number of items to
2017 Mar 28
2
A trap for young players with the lapply() function.
On 28/03/17 15:26, Charles C. Berry wrote:
> On Mon, 27 Mar 2017, Rolf Turner wrote:
>
>>
>> From time to time I get myself into a state of bewilderment when using
>> apply() by calling it with FUN equal to a function which has an
>> "optional" argument named "X".
>>
>> E.g.
>>
>> xxx <-
2010 Jan 27
1
control of scat1d tick color in plot.Predict?
...d by
scat1d, but after spending a fair bit of time going through documentation,
it still isn't clear to me how to do this in the context of lattice.
Guidance would be greatly appreciated.
Thanks,
Mike Babyak
Duke University Medical Center
My code using R 2.10.1/windows XP
myx<-c(1,2,3,4)
myy<-c(1,2,3,5)
library(rms)
d<-datadist(myx)
options(datadist="d")
myfit<-ols(myy~myx,x=T,y=T)
p1<-Predict(myfit,myx =.)
library(lattice)
#change line to black
line <- trellis.par.get("plot.line")
line$col <- 1
trellis.par.set("plot.line", line)
p...
2017 Mar 28
0
A trap for young players with the lapply() function.
...e that
function arguments named "X", "FUN", "USE.NAMES", etc. and perhaps
make use of R's lexical scoping to avoid having to use many arguments
to the function. E.g., instead of
sapply(1:5, sin)
use
sapply(1:5, function(theta) sin(theta))
or instead of
myY <- 3
sapply(1:5, atan2, y=myY)
use
myY <- 3
sapply(1:5, function(x) atan2(myY, x))
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Tue, Mar 28, 2017 at 2:30 PM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
> On 28/03/17 15:26, Charles C. Berry wrote:
>>
>&g...
2008 Jan 31
1
decrease amount of ticks on y axis in lattice levelplot
...atrix, whereas the row and
column names are the x and y ticks (and thus character data). I guess
that is character data is the root of the problem, but I don't know how
to solve it.
I tried to change the amount of ticks using yscale.components, but this
doesn't work:
yscale.components.myY <- function(...) {
Y <- yscale.components.default(...)
Y$left$ticks$at <- pretty(1,n=10)
Y$left$labels$at <- pretty(1,n=10)
return(Y)
}
print(levelplot(my_matrix),cuts=100,yscale.components=yscale.components.myY)
My full code can be found on pastebin:
http://pastebin.com/m16b267f9...
2008 Oct 29
1
How to set read.table variables to vectors?
...plot(xin, yin) : object "xin" not found
>
> split.screen(c(2,2))
[1] 1 2 3 4
>
> for (k in 0:3){
+
+ screen(k+1)
+ cnt <- 0
+ #grp<- iter * 5
+ for (i in 1:5000 ) {
+ if (iter<-k*5) {
+ cnt = cnt + 1
+ x[cnt] <- myx[i]
+ y[cnt] <- myy[i]
+ }
+ }
+ #p = cbind(x=rnorm(300), y=rnorm(300))
+ #p = cbind(x, y)
+ #tt = delaunayn(p)
+ #trimesh(tt,p,axis=TRUE,box=TRUE)
+ plot(myx,myy)
+ }
>
>
[[alternative HTML version deleted]]
2005 Jul 05
1
Kind of 2 dim histogram - levelplot
..., 36, 52 )
# bins
xb <- 1:4
yb <- 4:7
xble <- length( xb ) - 1
yble <- length( yb ) - 1
# fill data in bins
g <- expand.grid( x=xb[1:xble], y=yb[1:yble] )
g$cnt <- numeric( dim( g )[1] )
g$avg <- numeric( dim( g )[1] )
g$proz <- numeric( dim( g )[1] )
idx <- 1
for (myy in 1:yble) {
for (myx in 1:xble) {
xIdx <- which( ( (x >= xb[myx]) & (x < xb[myx + 1]) ) )
yIdx <- which( ( (y >= yb[myy]) & (y < yb[myy + 1]) ) )
bIdx <- intersect( xIdx, yIdx )
g[idx,3] <- length( bIdx )
g[idx,4] <- sum( val[bIdx] )/g[idx,3...
1999 Jan 20
0
dist(*, "euclidean") [was "dist function suggestion"]
> BDR> You will need to call it something else: dist is a clone of an S
> BDR> function, and dist(X, "manhattan") is well-established usage.
>
> one could still imagine an extra Y argument such that
> dist(X, Y=myY, method="euclidean")
> and dist(X, "euclidean", Y=myY)
> would work
> one could even make it such that
> both
> dist(X, myY)
> and dist(X, "euclidean")
> would work. However, the extra hack for dist(X, Y)
Um, I did think about that, but precise...
2013 Nov 21
2
overlaying 2D grid on randomly distributed points
Hi, I have a cloud of randomly distributed points in 2-dimensional space and want to set up a grid, with a given grid-cell size, that minimizes the distance between my points and the grid nodes. Does anyone know of an R function or toolbox that somehow addresses this problem? This is a problem of optimizing the location of the grid, not a problem of deciding what should be the grid-cell size,
2006 Aug 21
4
question about 'coef' method and fitted_value calculation
Dear all,
I am trying to calculate the fitted values using a ridge model
(lm.ridge(), MASS library). Since the predict() does not work for lm.ridge
object, I want to get the fitted_value from the coefficients information.
The following are the codes I use:
fit = lm.ridge(myY~myX,lambda=lamb,scales=F,coef=T)
coeff = fit$coef
However, it seems that "coeff" (or "fit$coef") is not really the
coefficients matrix. From the manual, "Note that these are not on the
original scale and are for use by the 'coef' method...".
Could anyone ple...
2007 Aug 30
5
Single plot multiple levels in x?
Plotting with 2 x axis?
One axis inside another, for example salary within state,
1-50 | 50 ? 100 | 100+ | 1- 50 | 50 -100 | 100+ | ? repeated bins for salary
AL ! AR ?? more states
The values are all stored with a single data frame. I have tried different things with the axis function and done many
2007 Nov 15
3
Graphics device storable in a variable
...alize are beyond the scope of this list), I
envision R code along the lines of the following:
# Create a png device, a handle to which is stored in myDevice
> myDevice <- png.variable(height = 1280, width = 1024, bg = "white")
# Plot some data into the current device
> plot(myX, myY, col="red")
# Finalize
> dev.off()
# Print out the contents of myDevice
> myDevice
...and the data would print out just like any other matrix or class or
whatever type myDevice actually is.
So my question is does such a thing already exist? I know about
piximage, but apparently I...
2006 Jul 03
1
xlab, ylab in balloonplot(tab)?
...# From balloonplot example:
# Create an example using table
xnames <- sample( letters[1:3], 50, replace=2)
ynames <- sample( 1:5, 50, replace=2)
tab <- table(xnames, ynames)
balloonplot(tab)
# Try xlab, ylab:
balloonplot(tab, xlab = "MyX", ylab = "MyY")
But second plot is no different from first.
R.version.string: Version 2.3.1 (2006-06-01)
gplots version: 2.3.0
on WinXP SP1
--
TIA,
Jim Porzak
Loyalty Matrix Inc.
San Francisco, CA
[[alternative HTML version deleted]]
2007 Oct 13
2
the use of the .C function
Dear All,
could someone please shed some light on the use of the .C or .Fortran function:
I am trying load and running on R the following function
// psi.cpp -- psi function for real arguments.
// Algorithms and coefficient values from "Computation of Special
// Functions", Zhang and Jin, John Wiley and Sons, 1996.
//
// (C) 2003, C. Bond. All rights reserved.
//
//
2012 Nov 16
2
[LLVMdev] porting to 3.1: ConstantDataArray
Hi,
In llvm 3.0 llvm::ConstantArray had a ::getAsCString() method that
returned the buffer as a std::string. Now it seems that 3.1 this
method dissapeared.
I found that llvm::ConstantDataArray has a method called
getAsString(), but it returns a Constant*.
What is the safe way to retrieve the pointer of the Constant array as
a C string?
2012 Nov 16
0
[LLVMdev] porting to 3.1: ConstantDataArray
On 16 November 2012 13:55, charles quarra
<charllsnotieneningunputocorreo at gmail.com> wrote:
> In llvm 3.0 llvm::ConstantArray had a ::getAsCString() method that
> returned the buffer as a std::string. Now it seems that 3.1 this
> method dissapeared.
>
> I found that llvm::ConstantDataArray has a method called
> getAsString(), but it returns a Constant*.
In 3.1
2007 Feb 12
2
Disk Failure Rates and Error Rates -- ( Off topic: Jim Gray lost at sea)
Selim Daoud wrote:
> here''s an interesting status report published by Microsoft labs
>
>
http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-2005-166
That is the paper in which Jim Gray coined "Mean time to data loss".
It''s been quoted here before.
Sad note: Turing award winner Jim Gray has been missing now for two
weeks, after he went
2008 May 20
2
Finding functions
Hi All:
Can anyone give me a hint about how to find functions
built in in R. based on the articule below it should
be something called DIYhelp but I can't find it.
Thanks
Part of the Kickstarting R package is a little text
searching facility called DIYHelp. The program is
based upon a simple, brute-force search of the
directory tree from the point that you specify. The
concept is that you