Displaying 20 results from an estimated 7000 matches similar to: "Strange parsing behavior of an else condition"
2004 May 03
2
Build problems on Linux SuSE 9.1
Hi,
did anybody succeed in building R on SuSE Linux 9.1?
My compilation failed with the following error messages:
make[4]: Entering directory `/home/lederer/Source/R-1.9.0/src/modules/X11'
gcc -I. -I../../../src/include -I../../../src/include
-I/usr/X11R6/include -I/us
r/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -mieee-fp -fPIC -g
-O2 -c d
ataentry.c -o dataentry.lo
In file
2003 Nov 13
4
Problem with parser and if/else
Dear r-help people,
could you confirm that this is correct behaviour for R? I am using RH9.
the code:
x1 <- 1:6
t1 <- 5
if (length(x1) >= t1) {
cat("in the if \n")
} else {
cat("in the else\n")
}
runs fine:
> source("test_if_else.R")
in the if
>
but the code:
x1 <- 1:6
t1 <- 5
if (length(x1) >= t1) {
cat("in the if 2\n")
}
2009 Mar 04
5
AEL2: If-then-else not permitted in Switch-Case
I just want to confirm but it seems that if-then-else is not permitted
in case structure.
It was not really documented but it seems to be the case.
Can anyone confirm?
switch(${DIALSTATUS})
{
case NOANSWER:
{
// if-then-else not permitted
If (${ael-var} = 1)
{
Playback(beep);
2012 Jan 13
1
IF ELSE
Can somebody explain the problem in the following expression?
Thank you
/> if (species == 1){
+ fitness <-
(1-b)*exp(-((microsites-niche.preference)/(niche.width.specialist+a.specialist)^2)*(1-a.specialist)
+ }else
Error: unexpected '}' in:
" fitness <-
2003 Jun 11
3
OpenLDAP Administration for Samba3
I am looking for an LDAP client to manage the LDAP server that we are going
to use when we switch to samba3. A Windows variety would be OK, a web
interface would be even better. Just looking for suggestions to try.
Thanks,
Brandon
2001 Oct 18
1
if/else at 1.3.1
Under NT with 1.3.1
if (x == 1) {
cat("Saw x=1\n");
} else {
cat("Saw x!=1\n");
}
works as expected, but
if (x == 1) {
cat("Saw x=1\n");
}
else {
cat("Saw x!=1\n");
}
is currently giving me a syntax error on the "else" line.
Apparently the parser considers the if statement to have
ended as soon as it sees first closing brace, unless
2003 May 28
5
Slow performance with QuickBooks
I have spent much of the day today researching performance tuning with
samba. I have tried everything that I can find out about how to make
performance faster. I checked disk performance with Bonnie, installed FTP
and tested a transfer that way, achieving 6-7 MB / second. about 30 seconds
for 150 MB file. I was finally able to achieve those speeds on a file
transfer to the server through
2005 Mar 07
4
simple if...else causes syntax error
I am trying to do the simplest thing in the world. The following works:
aaa <- ifelse(aaa==5, 6, 7)
But if I want to change the if...else syntax instead, it gives errors
and assigns 7 to aaa. Here is the problem code:
aaa <- 5
if ( aaa==5 ) {
aaa <- 6
}
else {
aaa <- 7
}
Here is the output:
> aaa <- 5
> if ( aaa==5
2019 Aug 16
1
Documenting else's greed
I was initially pretty shocked by the result in this question:
https://stackoverflow.com/questions/57527434/when-do-i-need-parentheses-around-an-if-statement-to-control-the-sequence-of-a-f
Briefly, the following returns 0, not 3 as might be expected:
if (TRUE) {
0
} else {
2
} + 3
At first I thought it the question was simply one of syntax
precedence, but I believe the result is too
2011 Nov 15
3
if/else scope
What is wrong with the following?
x <- 1:2
if(x[1] > 0)
{
if(x[2] > 0)
{
print("1 & 2 > 0")
}
else
{
print("1 > 0")
}
}
else
{
if(x[2] > 0)
{
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
2003 Jun 03
5
Archive attribute
Our tape backup software (run through windows) backs up items based on
whether the archive attribute is set or not. If it is set, then it needs to
be backed up. Then it removes the attribute. When a user modifies a file,
the attribute is again set. This is how it normally works. Samba will not
allow the Archive Attribute to be unchecked. Is there anyway to allow this
functionality.
Samba
2003 Jun 26
8
2.2.8a, printer driver download: need to use setdrive r
This is the EXACT problem I had. Haven't fixed it either.... if I have 10
printers.... upload all the drivers.. for all the OS's... how do I tell
which drivers go with which printer?
-----Original Message-----
From: Andreas [mailto:andreas@conectiva.com.br]
Sent: Thursday, June 26, 2003 9:24 AM
To: samba@lists.samba.org
Subject: [Samba] 2.2.8a, printer driver download: need to use
2004 Sep 15
7
Splitting vector into individual elements
Is there a means to split a vector into its individual
elements without going the brute-force route for arguments
to a predefined function call?
offred.rgb <- c(1, 0, 0) * 0.60;
## Brute force style
offred.col <- rgb(offred.rgb[1],
offred.rgb[2],
offred.rgb[3],
names = "offred")
## Desired style
2011 Jun 23
1
else problem
Dear R users,
I have run into a problem using if...else and I hope you can shed some light on it. I am using R version 2.2.0.1.
I have the following data frame:
> head(dat2f)
year tot_km3y
[1,] 1964 0.1876854
[2,] 1965 0.1835116
[3,] 1966 0.1915012
[4,] 1967 0.1869758
[5,] 1968 0.2249865
[6,] 1969 0.1916011
I need to pick out the median year, and since there are an even number of data,
2017 Jun 05
2
How the LLVM handle the debug location information of continue keyword and right brace(loop end location)?
If we had a very naïve way of generating IR, in the 'continue' case you would actually see TWO branch instructions: one to implement the 'continue' statement, and one as part of the control flow of the 'for' loop. The branch for the 'continue' statement would have the source location of the 'continue' and the branch for the control-flow of the 'for'
2017 Jun 02
2
How the LLVM handle the debug location information of continue keyword and right brace(loop end location)?
Let me show you the following simple C code:
int main()
{
int i;
for (i = 0; i < 256; i++)
{
i++;
}
}
In this simple C code, if we use Clang to compile it and debug it: We will get something like this:
(gdb) b main
Breakpoint 1 at 0x100000f7b: file a.c, line 5.
(gdb) r
Starting program: a.out
[New Thread 0x1403 of process 23435]
warning: unhandled dyld version (15)
Thread 2
2004 Dec 31
4
install.packages() for local source file
Wish to install a local source package on Un*x platform from
within R. Same thing as I can accomplish from cmdline as
$ export R_LIBS=~/R/library
$ cd /path/to/pkg
$ R CMD INSTALL -l $R_LIBS <pkgname>
So, how do you go about this anyway?
And isn't this a bug in 'install.packages'?
-------
$ R
R : Copyright 2004, The R Foundation for Statistical Computing
Version 1.9.0
2004 Jun 03
3
Sloppy argument checking for named arguments
Christian --
This is not a bug, but a feature, and the dot is not the issue here. R uses
partial argument matching on function arguments.
So:
> f <- function(foobar = 0){print(foobar)}
> f
function(foobar = 0){print(foobar)}
>
> f(fo=1)
[1] 1
> f(foo=1)
[1] 1
> f(foob=1)
[1] 1
> f(fooba=1)
[1] 1
> f(foon=1)
Error in f(foon = 1) : unused argument(s) (foon ...)
2010 Jul 19
5
par("uin") ?
I inherited a function written either for an older version of R or SPlus
to draw a brace, "{", in a graph. It uses par("uin") to determine the
scaling of the
quarter circles that make up segments of the brace, but that setting
doesn't
exist in current R.
I'm guessing that, in the function below, ux, uy can be defined from
par("usr") and