Displaying 20 results from an estimated 900 matches similar to: "How to fix it?"
2012 Oct 22
5
Help plz to fix it
I have an array of probabilities....it is p. So if user types x=1 then
probability is p1=1/10.
If user types x=2 it means that p2= p1+p2
if user types x=3 it means that p3=p1+p2+p3....and so on.
So i created a code..... but it doesnt work properly. Help me plz to fix it)
Thank u in advance.
psidp=function(x){
p<-(1/10 2/5 2/5 2/5 2/5 1/10 1/10 1/10 1/10 1/10)
i==0;
if (x!=0){
for
2007 Mar 27
1
"Groups" in XYPLOT
I'm not sure I'm barking up the right tree here, but would I need to make
use of groups to plot two separate datasets within ONE panel in xyplot? The
desired end result is a single xy plot of two separate (but similar in
values and ranges).
Full code follows, xyplot code at bottom
#########Determine Frequencies
##########coastal_slope
#needs the maptools package to read ESRI grid
2012 Oct 21
3
Help me please to code....
User has to type (input) x. After input....code has to check X with
statement if
There is a statement IF.
If X=0 then Y=5/2 else =7;
How to code it please. I tried but my code does not work ;( I wanna see how
it looks like( thank u in advance(
--
View this message in context: http://r.789695.n4.nabble.com/Help-me-please-to-code-tp4646932.html
Sent from the R help mailing list archive at
2012 Oct 25
3
How generate random numbers from given vector???
I wanna generate random numbers from a vector...
for example number<-c(0,1,3,4,5,6,8)
so
rsidp<-function(x){
i=0
for (i in seq(1:x))
{y<-sample(number,x, replace=T)}
return(y)
}
so all random numbers have to be from vector "number";
so if I type rsidp(5)..... it has to give me 5 random numbers except 2,7,9
(because they are not in the vector "numbers"). help
2012 Nov 18
1
Decimal places
I am a beginner in programmin in general and R specifically.
I would like to generate a set of random numbers in a normal distribution
but to limit the decimal places in these numbers to only 2.
I have been using x1 <- runif(1,0,1) to generate my numbers.
Can I add something to it to enable me to only get results rounded off to 6
decimal places?
--
View this message in context:
2012 Oct 26
3
wanna create all points.....
Plz help me ;(( I lost 7 hours for thinking and doing this code ;( I need to
create points.....20 points(dots). All these dots have to be in one graph...
when i run this code....it gives me only one dote.....
number<- (0,2,3,4,5,6,8)
for (i in seq(1:20))
{rsidpVector=rsidp(i)
mean(rsidpVector)
plot (length(rsidpVector), mean(rsidpVector), ylab="sample mean", xlab=
"sample
2012 Oct 26
1
Why my code does not draw? how to fix it? plz....
number<-c(0,1,3,4,5,6,8)
rsidp<-function(x){
i=0
{y<-sample(number,x,replace=TRUE)}
return(y)
}
plot(o, xlim=c(0,20), ylim(0,20), type="n", xlab="Sample size", ylab="Sample
variance")
for (i in seq(1:20)){
retVal=rsidp(i)
var(rsidpVector)
points (i, var(rsidpVector),pch=i,col=i)
}
--
View this message in context:
2004 Dec 15
2
how to fit a weighted logistic regression?
I tried lrm in library(Design) but there is always
some error message. Is this function really doing the
weighted logistic regression as maximizing the
following likelihood:
\sum w_i*(y_i*\beta*x_i-log(1+exp(\beta*x_i)))
Does anybody know a better way to fit this kind of
model in R?
FYI: one example of getting error message is like:
> x=runif(10,0,3)
> y=c(rep(0,5),rep(1,5))
>
2006 May 16
2
Changing expression font
I'm trying to label axes using 'expression', but I would also like to change the font to Times New Roman (a requirement of the journal). I'd appreciate any advice.
Here's one example of several things that I've tried, including changes to par() parameters 'family', 'font', 'font.axis', and 'font.lab', which are not shown below.
x <- 1:10
2003 Apr 07
1
filtering ts with arima
Hi,
I have the following code from Splus that I'd like to migrate to R. So far,
the only problem is the arima.filt function. This function allows me to
filter an existing time-series through a previously estimated arima model,
and obtain the residuals for further use. Here's the Splus code:
# x is the estimation time series, new.infl is a timeseries that contains
new information
# a.mle
2012 Apr 26
2
ErrError in f(x, ...) : object 'g.' not found
Hi , R is a new language for me so sorry in advance if this error is to basic
for posting. I have tried the R manual and search online for quite a few, if
anyone could help i would be very thankful.
Here is my code.
kappa = 1.1
theta = 0.1
sigma = 0.4
rho = -0.6
v0 = 0.2
r = 0.05
T = 0.5
s0 = 1
K = 0.5
type = 1
Hestoncall = function(kappa,theta,sigma,rho,v0,r,T,s0,K,type)
{
u = 0.5
b
2006 Feb 07
1
creating a certain type of matrix
Hi R users
I like to generate a certain type of matrix.
If there are 10 variables, the matrix will have nrow=10, ncol=((10/2))/5+1.
so the resulting matrix's dimension 10 by 2. If there are 50 variables the
dimension of the resulting matrix will be 50 by 6.
The arrangement of elements of this matrix is important to me and I can't
figure out how to arrange elements.
If I have 20
2009 Jul 16
2
Count the number of occurences in ranges
I got a vector of probabilities like,
probs<-c(0.001,0.5,0.02,1,.....)
Is there any nice and easy builtin function to get the number of
occurences within some specified probabality range.
Like with 2% it would be
occur[1] = sum(probs[probs>0&probs<0.02])
occur[2] = sum(probs[probs>0.02&probs<0.04])
...
occur[50] =sum(probs[probs>0.09] & probs<1)
(If it was a
2006 Feb 07
1
(second round) creating a certain type of matrix
Hi R users
Here is what I got with help from Petr Pikal (Thanks Petr Pikal). I modified
Petr Pikal's code to a little
to meet my purpose.
I created a function to generate a matrix
generate.matrix<-function(n.variable)
{
mat<-matrix(0,n.variable,(n.variable/2)/5+1) #matrix of zeroes
dd<-dim(mat) # actual dimensions
mat[1:(dd[1]/2),1]<-1 #put 1 in first half of first column
2009 Jan 16
1
ATA gateway with 2 ethernet interfaces
Hi,
I'm looking for an 8+ FXS ATA gateway (at least 8 ports but preferably at most 24 ports) with 2 ethernet interfaces for network/switch redundancy.
So far I've only found the Grandstream GXW4008.
I've searched similar brands such as Linksys and higher-end brands such as Quintum, but they all seem to have just one NIC. So, if the switch the ATA is connected to fails then I'm
2005 May 08
5
8+ line receptionist only setup
Hi,
We are looking towards a 8+ CO line setup (20 extensions) in our office
but we do not want an IVR(auto-attendant) feature. All incoming will be
answered by a receptionist. I have read the multi-line configuration for
cisco 7960 thread in this list but that way I believe we could only display
6 incoming lines. What will happen to the rest? Does the expansion module
for the cisco 7960 work
2008 Mar 13
2
joining matrices, vectors, scalars in one object
Hi,
I have:
a <- matrix(c(0,1,0,1),nrow=2)
b <- matrix(c(1,1,1,0,0,0),nrow=3)
c <- 1
d <- c(1,0,1)
And I would like to join them in an object 'thing' so that I can
access a, b, c, or d through an index in a for loop.
For example:
thing[4]
would return
[1] 1 0 1
Note however, that I have many of these 'thing' components. So many
that a command like
thing
2008 Mar 02
2
difference between lrm's "Model L.R." and anova's "Chi-Square"
I am running lrm() with a single factor. I then run anova() on the fitted
model to obtain a p-value associated with having that factor in the model.
I am noticing that the "Model L.R." in the lrm results is almost the same
as the "Chi-Square" in the anova results, but not quite; the latter value
is always slightly smaller.
anova() calculates the p-value based on
2013 Apr 29
2
CATENATE allows empty messages
Dovecot-2.2.1 allows empty messages to be APPENDed when using CATENATE:
b1 append inbox catenate (text {0+}
)
b1 OK [APPENDUID 1366726248 12] Append completed.
Contrast this with regular APPEND:
b2 append inbox {0+}
b2 NO Can't save a zero byte message.
Note that zero-size literals are OK but zero-size messages are not. So while "b1" above should fail like "b2",
2008 Feb 08
1
xspline(..., draw=FALSE) fails if there is no open device (PR#10727)
Full_Name: Jari Oksanen
Version: 2.6.2 RC (2008-02-07 r44369)
OS: Linux
Submission from: (NULL) (130.231.102.145)
Even if function xspline() is called with argument draw=FALSE, it requires a
graphics device (that it won't use since it was draw=FALSE). I run into this
because I intended to use xspline within a function (that does not yet draw:
there is plot method for that), and the function