Displaying 20 results from an estimated 1186 matches for "fx".
Did you mean:
fix
2004 Mar 10
5
do.call and environments
Hello,
I want to call a function "fx" given by name, where some "global"
variables (in the environment of fx) are passed to the function. For
compatibility reasons I cannot modify the parameter list of fx and I
want to avoid setting variables in the global environment (e.g. via <<-)
Is there a way, how to do t...
2006 May 24
3
How to make attributes persist after indexing?
...noted that some attributes like levels and class of a factor exist also
after indexing, while others, like comment or label vanish.
Is there a way to make an arbitrary attribute to be kept after indexing?
This would be especially useful when indexing a data.frame.
## example for loss of attributes
fx <- factor(1:5, ordered=TRUE)
attr(fx, 'comment') <- 'Comment for fx'
attr(fx, 'label') <- 'Label for fx'
attr(fx, 'testattribute') <- 'just for fun'
attributes(fx) # all attributes are shown
attributes(fx[]) # all attribute...
2009 Dec 18
1
Numerical Integration
...@ll. I have to calculate numerical integrals for triangular and trapezoidal figures. I know you can calculate the exactly, but I want to do it this way to learn how to proceed with more complicated shapes. The code I'm using is the following:
integrand<-function(x) {
print(x)
if(x<fx[1]) return(0)
if(x>=fx[1] && x<fx[2]) return((x-fx[1])/(fx[2]-fx[1]))
if(x>fx[2] && x<=fx[3]) return(1)
if(x>fx[3] && x<=fx[4]) return((x-fx[4])/(fx[3]-fx[4]))
if(x>fx[4]) return(0)
}
fx<-data[i,j,]
reltol<-1e-07
integrate(Vectorize(...
2006 Oct 14
4
Build error: Debian testing, libfox1.4, FXRuby-1.4.7
I''m getting compile errors when attempting to build FXRuby 1.4.7.
This happens when installing using gems, or when installing from
source:
g++ -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I/home/wayne/lab/fox/FXRuby-1.4.7/ext/fox14 -DHAVE_SYS_TIME_H -DHAVE_SIGNAL_H -I/usr/local/include/fxscintilla -I/usr/local/include/fox-1.4 -I/usr/include/fox-1.4 -fPIC...
2010 Jan 27
1
term.formula error when updating an nls object
..., .Names = c("Contrast", "Response"), class =
"data.frame", row.names = c(NA,
-6L))
m1 <- nls(Response ~
Rm * Contrast^ex/(Contrast^ex + sig^ex),
data = dd,
start = list(Rm = 30, sig = 0.05, ex = 3))
m2 <- update(m1, . ~
Rm * Contrast^ex/(Contrast^fx + sig^fx),
start = list(Rm = 30, sig = 0.05, ex = 3,
fx = 3.1))
Error in terms.formula(tmp, simplify = TRUE) : invalid power in formula
but there is nothing wrong with fitting the second model directly
with nls
m2a <- nls(Response ~
Rm * Contrast^ex/(Contrast^fx + sig^fx),
data = d...
2009 Feb 04
3
factor
I am looking into change the numeric order in the level of the factor
> x<-c("A","B","C")
> fx<-factor(x)
> fx
[1] A B C
Levels: A B C
> factor(x)
[1] A B C
Levels: A B C
> as.numeric(fx)
[1] 1 2 3
I want to change the order of the numeric into 3 corresponds to ?A? level, 2
corresponds to ?B? level and 1 corresponds to ?C? level
So when I type in
As.numeric(fx) I would like...
2004 Mar 11
4
Summary: do.call and environments
To use the modify the solution from Tony and I
so that you can pass the name of the function, rather
than the function itself, like this:
x <- 7
fx <- function(y) print(x*y)
f <- function(fun, x) {
fun <- get(fun)
environment(fun) <- environment()
do.call("fun",list(3))
}
f("fx",2)
---
Date: Thu, 11 Mar 2004 08:22:45 +0100
From: Thomas Petzoldt <petzoldt at rcs.urz.tu-dresden.de>...
2013 Apr 03
1
Problem with integrate function
Hello,
The following code of mine is giving the error:
Error in integrate(fx[[2]], 0.056, 1) :
maximum number of subdivisions reached
Can anyone help?
Thanks and Regards.
Swagato
--------------------------
fv<-vector("list")
fx<-vector("list")
v<-0
c<-0
n<-0
NOV<-0
i<-0
while(n<200){
fv[[1]]<-function(x)1 #prior functi...
2005 Sep 29
2
solution of convolution equation
...dy can help me...
I am trying to find a solution of a convolution equation using fft (and
unfortunately I do not have a good background for this).
So I am just trying to figure out how it can be implemented in R. I have
two multidimensional independent variables X and Z
and I know their densities fx and fz, which are multidimensional arrays.
So I have to find the density of Y, such that X+Y=Z.
So, first I tried on a simple example, where the variables are
one-dimensional, say X is N(0,1) and Z is N(7,3).
So I want to find the density of Y (which should be N(7, sqrt(8)).
I did:
x <- seq(-6...
2004 Nov 26
2
T1 and FX CPE
...year old Panisonic system with Cisco 7940 phones and a
T1. Problem is, they have to keep 1 POTS line for directory listing and 911
emergency failover.
I would like suggestions on how to accomplish this. Our asterisk cluster
is downtown so we can do the T1 between us and them easily. However, the
FX911 is the big problem. Lets say that the T1 line goes down and someone
tries to dial 911. Normally the call would go over the T1 down to asterisk
cluster and go out over PRI or an FX card. But if the T1 is down, you can't
do that. So, the POTS line needs to be plugged into something at the
cust...
2011 Apr 09
1
How do I make this faster?
...s[grep(pattern='oz.', fixed=T, x
=as.vector(oanda.currencies$oanda.df.1.length.oanda.df...2....1.)) == F])
correlations <- vector()
values <- list()
# optimise these loops using the apply family
for (i in currencies) {
for (j in currencies) {
if (i == j) next()
fx <- getFX(paste(i, j, sep='/'), from='2009-11-20', to='2011-04-02')
# Prepare data by getting rates for market days only
fx <- get(fx)
fx <- fx[which(index(fx) %in% index(QQQ$QQQ.Close))]
correlation <- cor(fx, QQQ$QQQ.Close)
correlat...
2010 Jun 02
1
lattice, xyplot, using "panel.segments" by just addressing one panel
...up in all other panels,
too. Tried functions like [panel.number()], but didn't work.
Would be so great, if somebody could help me with that!
That's the code, I used:
library(lattice)
library(latticeExtra)
#[...]
attach(mydata)
attach(links) #containing the coordinates for the segments fx, fy, tx, ty
fx <- fx
fy <- fy
tx <- tx
ty <- ty
xyplot(LogN~LogM|factor(surber),
par.settings = list(strip.background = list(col = "transparent")),
xlab = "Log M", ylab = "Log N",
layout = c(6,5), aspect = 1, as.table = TRUE, strip=FALSE,
panel=function...
2002 Dec 12
1
equation on the object
Hi,
I try to put an equation on a object to use in curve for example,
but it don't work, it possible to make a object of an equation?
ex.
fx <- a + b*x
for(a in 0){for(b in 1){curve(fx,...)}}
Thanks you
Ronaldo
ps. Exist in R any functions to estimate severals curves parameters (non
interactive) for a dataset? Something like table-curve 2d.
--
If Karl, instead of writing a lot about Capital, had made a lot of Capital,
it would h...
2009 Feb 12
1
Latex or html output for freq() in prettyR
...ook
look the console output.
See the following example
library(prettyR)
library(Hmisc)
x <- matrix(sample(1:3, 12, replace=TRUE), nrow=3, dimnames=list(c('A','B',
'C'),letters[1:4])) # create a 3x4 matrix with random numbers beteen 1 and 3
x # see what it looks like
fx=freq(x) # create frequency table with frequencies and % per column
fx # looks pretty good, now I want to export it to latex or html
html(fx) # I expected this to look like console output but it doesn't. Can
anything be done?
fm=as.matrix(fx) #It can't be coerced into a matrix or table (a...
2013 Jul 23
1
Help with using unpenalised te smooth in negative binomial mgcv gam
...,
I have been trying to fit an un-penalised gam in mgcv (in order to get more
reliable p-values for hypothesis testing), but I am struggling to get the
model to fit sucessfully when I add in a te() interaction. The model I am
trying to fit is:
gam(count~ s(x1, bs = "ts", k = 4, fx = TRUE) +
s(x2, bs = "ts", k = 4, fx = TRUE) +
te(x2, x3, bs = c("ts", "cc"), fx = TRUE) +
log(offset(y)),
knots = list(x3=c(0,360)), family = negbin(c(1,10)))
The error message I get is:
"Error in sm[[i]]$S[[j]] : attempt to s...
1998 Apr 12
3
R-beta: S Compatibility (again)
While I think total compatibility is not possible or even very
important I have become aware recently of some fairly low level
incompatibilities that have rather serious consequences for
interchange between systems. Some of these are possibly well
known, but I put them on on record here just in case. (I do not
expect any action on these, of course, but people may want to
note them, and correct
1998 Apr 12
3
R-beta: S Compatibility (again)
While I think total compatibility is not possible or even very
important I have become aware recently of some fairly low level
incompatibilities that have rather serious consequences for
interchange between systems. Some of these are possibly well
known, but I put them on on record here just in case. (I do not
expect any action on these, of course, but people may want to
note them, and correct
2007 Mar 31
3
strange fisher.test result
A simple question - using the following fishers test it appears that the P value is significant, but the CI includes 1. Is this result correct?
> data.50p10min <- matrix(c(16,15, 8, 24),nrow=2)
> fisher.test(data.50p10min)
Fisher's Exact Test for Count Data
data: data.50p10min
p-value = 0.03941
alternative hypothesis: true odds ratio is not equal to 1
95
1999 Oct 08
1
floor(NaN) problem fixed in massdist.c (PR#291)
...os = NaN, it
shouldn't go into the following "if" statement. But it goes inside on
Alpha/Linux (because ixmin is 0), and set y[0] and y[1] to NaN.
Following is extracted from massdist.c
for(i=0 ; i<*nx ; i++) {
xpos = (x[i] - *xlow) / xdelta;
ix = floor(xpos);
fx = xpos - ix;
if(ixmin <= ix && ix <= ixmax) {
y[ix] += (1.0 - fx);
y[ix + 1] += fx;
}
else if(ix == -1) {
y[0] += fx;
}
else if(ix == ixmax + 1) {
y[ixmax + 1] += (1.0 - fx);
}
}
So I think the statement
if(ixmi...
2004 Dec 16
1
Polycom FX Video Unit - asterisk-oh323
I'm installing an office in a couple of weeks that will have some nice
Polycom FX video units in the conference rooms. I'm thinking that with
asterisk-oh323
http://www.inaccessnetworks.com/ian/projects/asterisk-oh323/#section2
I should hopefully get the ability for phone users to dial an extension
and participate in video conferences, or just simply phone conference with...