could also wrap all the
code in a function and use the debugger to step through that (which may help if
the error occurs in an iteration of a loop body).
Regards,
Jorgen Harmse.
Message: 1
Date: Mon, 27 Jan 2025 22:46:21 +
From: Naresh Gurbuxani
To: "r-help@r-project.org"
Subject:
he design was probably too devious in the first place.
}
}
Regards,
Jorgen Harmse.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/
to extract the expression without evaluating
it?
g <- function(...)
{ pos <- match('a',...names())
if (is.na(pos))
stop("a is missing.")
(function(a,...) substitute(a)) (...)
}
Regards,
Jorgen Harmse.
Message: 8
Date: Sun, 5 Jan 2025 11:17:02 -0800
From
I think that Stevie Pederson has the right idea, but it is not obvious what the
threshold should be. Example:
> n <- 2428716; sum(rep(1/n,n)) - 1
[1] -3.297362e-14
I assume that equally large errors in the other direction are also possible.
Regards,
Jorgen
s)*1i)
is pi/2, and the real part of atan((1-.Machine$double.eps)*1i) is zero, and
someone apparently decided to average those for atan(1i).
TL;DR: The documentation needs more details, and I don't really like the
extended complex plane that R implemented, but within that frame
oval
must be 'o' or 'O', not the digit '0'. (Digits after the first character are
standard.)
Regards,
Jorgen Harmse.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIB
latter case, why
stash them in a variable? For more control of the display, consider sprintf (or
a wrapper that combines sprintf with cat).
Regards,
Jorgen Harmse.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To
which(grepl()) looks odd. Doesn't grep by itself return the correct vector
of indices?
Regards,
Jorgen Harmse.
Message: 5
Date: Fri, 12 Jul 2024 17:42:05 +0800
From: Steven Yen mailto:st...@ntu.edu.tw>>
To: Uwe Ligges mailto:lig...@statistik.tu-dortmund.de>>, R-help Mail
or other machinery to thin it out.
Regards,
Jorgen Harmse.
--
Message: 1
Date: Mon, 20 May 2024 14:36:58 +0100
From: Nick Wray mailto:nickmw...@gmail.com>>
To: r-help@r-project.org <mailto:r-help@r-project.org>
Good luck! It looks like a significant effort for someone not already on the
team.
Regards,
Jorgen Harmse.
From: Mark Webster
Date: Monday, May 13, 2024 at 04:07
To: Jorgen Harmse , Ivan Krylov
Cc: r-help@r-project.org
Subject: [EXTERNAL] Re: duplicated() on zero-column data frames returns
our
would be to issue a warning that the change is coming in a future version.) The
protection for old code could be just a warning that can be turned off with a
call to options. The new documentation should be more explicit.
Regards,
Jorgen.
From: Mark Webster
To: Jorgen Harmse , Ivan Krylov
(I do not know how to make Outlook send plain text, so I avoid apostrophes.)
For what it is worth, I agree with Mark Webster. The discussion by Ivan Krylov
is interesting, but if duplicated really treated a row name as part of the row
then any(duplicated(data.frame(�))) would always be FALSE. My
> Turns out that RStudio replaces the install.packages object in the utils
> package.
> Duncan Murdoch
So RStudio unlocks the bindings and alters the exported environment? That seems
like another reason to stick to the terminal interface.
>> Thank you. tools:::.install_packages works.
> I'm gl
urce) )
file.copy(DESC.source, file.path(package.dir,"DESCRIPTION"), overwrite=TRUE)
roxygenise(package.dir,clean=clean)
tar <- devtools::build(package.dir)
if (install)
install.packages(tar,type='source',repos=NULL)
invisible()
}
From: Ivan Krylov
Date:
x27;width')}
#'
#' @export
width <- function(dw) options(width = options('width')[[1L]] + as.integer(dw))
From: Duncan Murdoch
Date: Wednesday, March 20, 2024 at 12:09
To: Jorgen Harmse , Ivan Krylov , Jorgen
Harmse via R-help
Subject: [EXTERNAL] Re: [R] Buildi
From: Ivan Krylov
Date: Wednesday, March 20, 2024 at 11:14
To: Jorgen Harmse via R-help
Cc: Jorgen Harmse
Subject: [EXTERNAL] Re: [R] Building Packages.
� Wed, 20 Mar 2024 16:02:27 +
Jorgen Harmse via R-help �:
> > install.packages(tar,type='source',repos=NULL)
>
I have a source file with oxygen-style comments (and description & licence
files), and I’m trying to build a package. oxygen & devtools seem to work, and
the tarball exists, but install.packages balks. Does anyone know what’s
happening?
Regards,
Jorgen Harmse.
> roxygenise(packag
mes.")
return(L[[1L]])
}
if (missing(yes1))
{ if (length(L <- list(...)) != 0L)
stop("Wrong number of arguments or confusing argument names.")
return(test1)
}
return( ifelse(test1, yes1, ifelses(...)) )
}
Regards,
Jorgen Harmse (not Jordan).
-
of another formula?
Regards,
Jorgen Harmse.
From: CALUM POLWART
Date: Saturday, November 4, 2023 at 18:23
To: avi.e.gr...@gmail.com
Cc: Jorgen Harmse , r-help@r-project.org
, mkzama...@gmail.com
Subject: [EXTERNAL] Re: [R] I need to create new variables based on two numeric
variables and one
egards,
Jorgen Harmse.
From: avi.e.gr...@gmail.com
Date: Friday, November 3, 2023 at 16:12
To: Jorgen Harmse , r-help@r-project.org
, mkzama...@gmail.com
Subject: [EXTERNAL] RE: [R] I need to create new variables based on two numeric
variables and one dichotomize conditional category variables
df$LAP <- with(df, ifelse(G=='male', (WC-65)*TG, (WC-58)*TG))
That will do both calculations and merge the two vectors appropriately. It will
use extra memory, but it should be much faster than a 'for' loop.
Regards,
Jorgen Harmse.
--
Mess
Ivan Krylov points out that load(file, e <- new.env()) is cumbersome. I put it
into a function.
Regards,
Jorgen Harmse.
#' Save & load lists & environments
#'
#' \code{\link{save}} has to be told what to save from an environment, and the
obvious way
#' to sa
{�, and
parse(text=�.) to break the function into expressions. That might be easier
than copy-pasting function code.
Regards,
Jorgen Harmse.
Message: 1
Date: Tue, 19 Sep 2023 23:09:18 +0530
From: Brian Smith
To: r-help@r-project.org
Subject: [R] Could you manually replicate execution of a R f
matrix must have the same type.
Regards,
Jorgen Harmse.
Message: 1
Date: Tue, 7 Feb 2023 07:51:50 -0500
From: Naresh Gurbuxani
To: "r-help@r-project.org"
Subject: [R] preserve class in apply function
Message-ID:
Content-Type: text/plain; charset="us-ascii"
2
Date: Sun, 22 Jan 2023 14:25:59 +
From: akshay kulkarni
To: Jorgen Harmse , "r-help@r-project.org"
, "williamwdun...@gmail.com"
Subject: Re: [R] [EXTERNAL] Re: function doesn't exists but still
runs. (akshay kulkarni)
gging the public package
function because it didn't do what you expected, or were you just curious how
it worked?
Regards,
Jorgen.
From: akshay kulkarni
Date: Friday, January 20, 2023 at 11:19
To: Jorgen Harmse , r-help@r-project.org
, williamwdun...@gmail.com
Subject: [EXTERNAL] Re
cts and everything in the ancestor environments. You
can repeat the trick to see private environments of packages you didn't
directly pull in. I think you can even unlock bindings and do ghastly things to
the package's private environment.
Regards,
Jorgen Harmse.
---
data frame
will be meaningful.
Regards,
Jorgen Harmse.
From: R-help on behalf of
r-help-requ...@r-project.org
Date: Friday, 16December, 2022 at 05:00
To: r-help@r-project.org
Subject: [EXTERNAL] R-help Digest, Vol 238, Issue 16
Message: 1
Date: Thu, 15 Dec 2022 13:52:35 +
From: Stefano
use delayedAssign
to preserve short-circuit behaviour), but I was discussing my line-break
preferences in case breaks are needed.
Regards,
Jorgen Harmse.
From: Ebert,Timothy Aaron
Date: Friday, 28October, 2022 at 10:22
To: Jorgen Harmse , r-help@r-project.org
Subject: [EXTERNAL] RE
ructure of the code, and I would
usually rather throw in a few extra delimiters than obscure the structure.
Regards,
Jorgen Harmse.
Examples (best viewed in a real text editor so things line up):
{ if (x
To: Jinsong Zhao
Cc: "r-help@r-project.org"
Subject: Re: [R] unexpected 'el
Good catch! I also misread it, and I think most people would. If I wanted to
write confusing documentation then I could play similar games with 'mode' and
'length'.
Regards,
Jorgen Harmse.
> test <- c(TRUE,FALSE,FALSE)
> attr(test,'class') <-
I agree that the documentation should be clarified. Moreover, my last example
shows that the class can be different even when no mode coercion is required. I
don't know enough about S3 & S4 to comment on your last point.
Regards,
Jorgen Harmse.
From: Bert Gunter
Date: Monday, 24Octo
o the classes of `yes` & `no`.
Regards,
Jorgen Harmse.
> ifelse(FALSE, {cat("Evaluating the vector for 'if'.\n"); 1:3},
> {cat("Evaluating the vector for 'else'.\n"); 0:4})
Evaluating the vector for 'else'.
[1] 0
> ifelse(rep
,
Jorgen.
> evalq( if (FALSE)
cat("This shouldn't happen.\n")
else
cat("Everything is fine.\n"),
+ .GlobalEnv
+ )
Everything is fine.
> x <- 1:5
> x[ if(FALSE) 1L
+else 2L
+ ]
[1] 2
From: Andrew Simmons
Date: Friday, 21October, 2022 at
NULL if the condition is FALSE, so it might be necessary
to undo an assignment, and that seems very difficult.)
Regards,
Jorgen Harmse.
On Fri., Oct. 21, 2022, 05:29 Jinsong Zhao, wrote:
> Hi there,
>
> The following code would cause R error:
>
> > w <- 1:5
> > r
,LF)
else if (target %in% c(�Unix�,�Mac�))
eol <- LF
else if �.
else
stop(�Unexpected target.�)
write.table(eol=eol, �.)
Regards,
Jorgen Harmse.
Message: 7
Date: Tue, 27 Sep 2022 11:35:54 -0400
From: "Stephen H. Dawson, DSL"
To: Bert Gunter
Cc: r-help
Subject: Re: [R] Q
using a hash of
something involving the unique key. Then the selection of a salt is the
equivalent of a call to set.seed in non-parallel processing. The results should
be the same as long as you fix the data set & the salt, and then you can test
sensitivity to changes in the salt.
Jorgen Ha
rom all but the last argument.
> base::file.path('foo/','bar')
[1] "foo//bar"
> file.path('foo/','bar')
[1] "foo/bar"
Incidentally, I don't like T & F for Booleans (or t for transpose) in
production code. Single letters
length and some
overloading of list functions to ensure that that is always true.) The other
answers confused me more.
Regards,
Jorgen Harmse.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more
[cond],b[cond]) is what we want), or it
might return a+rev(b). Avi Gross correctly notes that the implementation is not
what he wants, but I think that what he wants is possible only in special cases.
Regards,
Jorgen Harmse.
Message: 2
Date: Sat, 9 Oct 2021 15:35:55 -0400
Fro
ion.
Jorgen Harmse.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, s
identical(df[1,],df[2,]) is FALSE because of the row names. all( == ) is just a
work-around that I attempted.
Jorgen.
On Mar 11, 2013, at 02:53 , PIKAL Petr wrote:
>>
>>> df <- data.frame(x=c(1,1,NA,NA), y=c(2,2,7,7))
>>> identical(df[1,],df[2,])
>> [1] FALSE
>>> all(df[1,]==df[2,])
>> [1] TRU
42 matches
Mail list logo