Displaying 20 results from an estimated 5000 matches similar to: "if/else statement without curly brackets gives a problem"
2009 Mar 31
2
Generating EPS figures automatically (like Sweave)
Hello,
Is there a way to generate EPS figures automatically out of a chunk
of code? Basically, I would like to do something like Sweave does (I
just find it a little cumbersome to create a .Rnw file and then keep
track of the figure numbering). Thanks for your time.
Ery Arias-Castro
2008 Jan 16
1
outer on matrices / arrays
Hi,
I would like to evaluate a function f(x,y) taking two vectors as
entries on all pairs of X rows and Y rows, where X and Y are n-by-p
and m-by-p matrices respectively. Of course, I would like to avoid
loops if possible, as the dataset I want to process is quite large.
I was not able to find a combination of outer() and apply() to do
this -- note that I am fairly new to R. Below is
2009 Dec 29
1
plotting circles with symbols()
Hello,
I am not able to plot a circle of a given radius using symbols(). In
the example below, the circle appears too large:
plot(0, 0, xlim = c(-1, 1), ylim = c(-1, 1))
symbols(0, 0, circles = 1, inches = FALSE, add = TRUE)
What's happening?
Ery
2009 Nov 13
4
Simple if else statement problem
Hello, I am getting an error with the following code:
if( P2 > P1)
+ {
+ P<-P2
+ }
> else
Erro: unexpected 'else' in "else"
> {
+ P<-P1
+ }
I checked the syntax so I don?t understand, I have other if else statements
with the same syntax working. Thanks in advance
--
View this message in context:
2009 Oct 03
3
else if statement error
Hello,
I am doing a simple if else statement in R. But it always comes out error
such as 'unexpected error'
There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2,
a=5; all other situations, a=6. I don't know where it is wrong.
Here is my code
ini=3
b=4
if (ini==1) {
a=3
}
else if (ini>1 and b>2 ) {
a=5
}
else {a=6}
Thanks a
2007 Oct 17
0
curly bracket in plot (reply)
I used the wrong address. This was meant as a reply to another post.
On 10/17/07 10:55, thomas.schwander at mvv.de wrote:
> Hi Jonathan,
>
> I read your post in the R-Help. Did you get rid off the problem? I'm standing inf
> ront of the same problem... If you've got an answer to me to drae a curly bracket,
> could you please be so kind to tell me who you did?
I missed
2011 Dec 23
3
if statement problem
Hello,
I want to do fisher test for the rows in data file which has value less than
5 otherwise chi square test .The p values from both test should be stored in
one resulted file. but there is some problem with bold if statement. I don't
know how
implement this line properly.
x = cbind(obs1,obs2,exp1,exp2)
a = matrix(c(0,0,0,0), ncol=2, byrow =TRUE) #matrix with initialized
values
2006 Nov 02
1
Res: graphics not find source
In ubuntu 6,06 the R normally run, but latter to install the a vesion
6,10 plot this not appearing.
computer with problem:
/usr/share/X11/fonts$ ls
misc Type1 X11R7
In computer OK:
/usr/share/X11/fonts$ls
100dpi(*) 75dpi encodings fonts.cache-1 misc Type1
----- Mensagem original ----
De: Peter Dalgaard <p.dalgaard@biostat.ku.dk>
Para: Ricardo Arias Brito
2009 Jan 09
5
The R Inferno
"The R Inferno" is now on the Burns Statistics website at
http://www.burns-stat.com/pages/Tutor/R_inferno.pdf
Abstract: If you are using R and you think you're in hell,
this is a map for you.
Also, I've expanded the outline concerning R on the
Burns Statistics 'Links' page. Suggestions (off-list) for
additional items are encouraged.
Patrick Burns
patrick at
2009 Jun 05
5
How run AsyncAGI commands in background
Hi all,
I have an external application commanding asterisk by AMI and AsyncAGI. I
also have a dialplan like this:
; AsyncAGI extensions
exten => _8.,1,Noop(entering in AGI loop at 8 ${EXTEN});
exten => _8.,n,AGI(agi:async);
exten => _8.,n,Hangup();
; Meetme extensions
exten => _1.,1,Noop(Conference ${EXTEN} ${CONTEXT});
exten =>
2013 Jan 30
1
[PATCH v2] xen: print "debug=y|n" during hypervisor startup
So that we can easily figure out whether or not we are running a
debug build of Xen (e.g., via `xl dmesg'').
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Changes from v1:
* moved the #ifndef-ery around variable definition;
* repositioned the "debug=%c" outside of the ''compiled-by'' section.
diff --git a/xen/drivers/char/console.c
2010 Dec 23
1
speed issues? read R_inferno by Patrick Burns: & a memory query
Hi,
I'm just starting out with R and came across R_inferno.pdf by Patrick Burns
just yesterday - I recommend it!
His description of how 'growing' objects (e.g. obj <- c(obj,
additionalValue) eats up memory prompted me to rewrite a function (which
made such calls ~210 times) so that it used indexing into a dimensioned
object instead (i.e. obj[i, ] <- additionalValue).
This
2008 Sep 30
3
question about reports
when a node tries to send a report it drops the following error:
err: Reporting failed: undefined method `graph'' for
#<Puppet::Transaction::Report:0xb7060948>
on the server i have:
reports = rrdgraph,store
reportdir = /var/www/puppetreports
rrddir = /var/www/html/rrd
rrdinterval = $runinterval
rrdgraph =
2012 Jul 17
3
complexity of operations in R
Hello!
I am optimizing my code in R and for this I need to know a bit more about
the internals. It would help tremendously if someone could link me to a
page with O()-complexities of all the operations.
In this particular case, I need something like a linked list with O(1)
insertLast/First ability. I can't preallocate a vector since I do not know
the final size of the list ahead of time.
The
2011 Oct 13
2
boxplot
hello
I want to make a boxplot with diferents rows and also include a column to sort into two groups to each of the other columns
my date set looks like this:
4 5 6 7 8 site
23 56 41 45 63 C
21 89 42 10 63 E
32 45 14 17 96 E
45 74 13 63 41 C
68 32
2016 Feb 21
3
Streaming MOVE commands
Hello Timo,
Timo Sirainen <tss at iki.fi> writes:
> Thanks, looks like this was broken with Maildir and mbox formats. It
> also caused expunges in some other situations to be lost. Fixed:
>
> https://github.com/dovecot/core/commit/950a6e61d6c2dac961ce031bdd8b2895bc32b827
Thanks a lot for the fix, testing it now!
Is this patch suitable of being backported to 2.2.13? (Debian
2008 Mar 05
0
EM algorithm
Hi,
I am trying to understand how the functions em() and me() from the
mclust package work. I cannot make sense of what the algorithm
returns. Here is a basic, simple example:
#########################################
# two bivariate normals, centered at (-5,0) and (5,0), with Id
covariance
x1 = cbind(rep(-5, 100), rep(0, 100)) + matrix(rnorm(100*2), 100, 2)
x2 = cbind(rep(5, 100),
2007 Jan 19
3
if else statement
Hello,
I'm doing some scripting and I've noticed that R doesn't seem to
have an
if (cond){
do
}ifelse (cond) {
do
} else {
do
}
type block.
Is this correct or am I missing something.
THX
Paul
--
Research Technician
Mass Spectrometry
o The
/
o Scripps
\
o Research
/
o Institute
2009 Oct 03
1
if else statement error
Hello,
I am doing a if else statement in R. But it always comes out error such as
'unexpected symbol'
There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2,
a=3; all other situations, a=6. I don't know where it is wrong.
Here is my code
ini=3
b=4
if (ini==1) {
a=3
}
else if (ini>1 and b>2 ) {
a=3
}
else {a=6}
Thanks a
2009 Oct 27
1
New vector based on if/else statement within for loop?
Hello,
I am trying to create a new vector (w) that is based on comparing two
vectors (P and Z). The compaison is simple (I created a for loop that
reassigns w based on if statement), all Z values >= 24 and P values <=1,
w=88 else w=77. I am not getting the correct results for w, see
example code below. Any thoughts or suggestions on the correct method.
Thank you,
Doug
P <-