Dear John,
Printing inside the function is problematic. Your function itself does
NOT print the labels.
Just as a clarification:
F = factor(rep(1:2, 2))
by(data.frame(V = 1:4, F = F), F, function(x) { print(x); return(NULL); } )
# V F
# 1 1 1
# 3 3 1
# V F
# 2 2 2
# 4 4 2
# F: 1 <- this i
Another solution could also be possible - see below.
On 10/21/2023 10:38 PM, Leonard Mada wrote:
My mistake!
It does actually something else, which is incorrect. One could still
use (although the code is more difficult to read):
subset(tmp <- table(sample(1:10, 100, T)), tmp > 1
My mistake!
It does actually something else, which is incorrect. One could still use
(although the code is more difficult to read):
subset(tmp <- table(sample(1:10, 100, T)), tmp > 10)
Sincerely,
Leonard
On 10/21/2023 10:26 PM, Leonard Mada wrote:
Dear List Members,
The
Dear List Members,
There was recently an issue on R-devel (which I noticed only very late):
https://stat.ethz.ch/pipermail/r-devel/2023-October/082943.html
It is possible to use subset as well, almost as initially stated:
subset(table(sample(1:5, 100, T)), table > 10)
# Error in table > 10 :
#
Dear Rui,
On 10/18/2023 8:45 PM, Rui Barradas wrote:
split_chem_elements <- function(x, rm.digits = TRUE) {
regex <- "(?<=[A-Z])(?![a-z]|$)|(?<=.)(?=[A-Z])|(?<=[a-z])(?=[^a-z])"
if(rm.digits) {
stringr::str_replace_all(mol, regex, "#") |>
strsplit("#|[[:digit:]]") |>
lapply(\
there is anything like is.numeric, but to
parse each element of a vector.
Sincerely,
Leonard
On 10/18/2023 6:53 PM, Rui Barradas wrote:
Às 15:59 de 18/10/2023, Leonard Mada via R-help escreveu:
Dear List members,
What is the best way to test for numeric digits?
suppressWarnings(as.double(c
Dear List members,
What is the best way to test for numeric digits?
suppressWarnings(as.double(c("Li", "Na", "K", "2", "Rb", "Ca", "3")))
# [1] NA NA NA 2 NA NA 3
The above requires the use of the suppressWarnings function. Are there
any better ways?
I was working to extract chemical eleme
23 7:41 PM, Leonard Mada wrote:
Dear Jason,
I do not think that the solution based on aggregate offered by GPT was
correct. That quasi-solution only aggregates for every individual level.
As I understand, you want the cumulative sum. The idea was proposed by
Bert; you need only to sort firs
Dear Jason,
I do not think that the solution based on aggregate offered by GPT was
correct. That quasi-solution only aggregates for every individual level.
As I understand, you want the cumulative sum. The idea was proposed by
Bert; you need only to sort first based on the cutoff (e.g. usin
es as documented in Writing R Extensions.
If your goal is to not use source files this way then the solution is to not
use roxygen at all. Just create those files yourself by directly editing them
from scratch.
On September 3, 2023 7:06:09 PM PDT, Leonard Mada via R-help
wrote:
Thank you
specified by the
> "Writing ..." manual.
>
> Again, further questions and elaboration should go to the
> R-package-devel list, although I think the manual is really the
> authoritative resource to follow.
>
> Cheers,
> Bert
>
>
>
> On Sun,
Dear R-List Members,
I am looking for collaborators to further develop the BioShapes
almost-package. I added a brief description below.
A.) BioShapes (Almost-) Package
The aim of the BioShapes quasi-package is to facilitate the generation
of graphical objects resembling biological and chemic
Dear R-Users,
Just out of curiosity:
Which of the 2 methods is the better one?
The results seem to differ slightly.
fun = function(u){((26104.50*u^0.03399381)/((1-u)^0.107)) - 28353.7}
uniroot(fun, c(0,1))
# 0.6048184
curve(fun(x), 0, 1)
abline(v=0.3952365, col="red")
abline(v=0.6048184,
o the exact value!
y <- 1 - x^2/2;
1/(1 - y) - 2/x^2
# 58672303, not 0, nor close to 0;
Sincerely,
Leonard
>
> On Fri, Aug 18, 2023 at 4:34 PM Leonard Mada wrote:
>
> Dear Bert,
>
>
> Values of type 2^(-n) (and its binary complement) are exactly
> represented
t numbers (and their arithmetic)
>
> Cheers,
> Bert
>
>
> On Fri, Aug 18, 2023 at 3:25 PM Leonard Mada via R-help
> wrote:
>
> I have added some clarifications below.
>
> On 8/18/2023 10:20 PM, Leonard Mada wrote:
> > [...]
> > After mo
I have added some clarifications below.
On 8/18/2023 10:20 PM, Leonard Mada wrote:
[...]
After more careful thinking, I believe that it is a limitation due to
floating points:
[...]
The problem really stems from the representation of 1 - x^2/2 as shown
below:
x = 1E-4
print(1 - x^2/2
= 1 + cos(x)
cos1n(x) = 1 - cos(x)
Though, I do not have yet the big picture.
Sincerely,
Leonard
On 8/17/2023 1:57 PM, Martin Maechler wrote:
Leonard Mada
on Wed, 16 Aug 2023 20:50:52 +0300 writes:
> Dear Iris,
> Dear Martin,
> Thank you very much for your r
ve that there is room for improvement.
Sincerely,
Leonard
On 8/16/2023 9:51 AM, Iris Simmons wrote:
> You could rewrite
>
> 1 - cos(x)
>
> as
>
> 2 * sin(x/2)^2
>
> and that might give you more precision?
>
> On Wed, Aug 16, 2023, 01:50 Leonard Mada via R-help
&
Dear R-Users,
I tried to compute the following limit:
x = 1E-3;
(-log(1 - cos(x)) - 1/(cos(x)-1)) / 2 - 1/(x^2) + log(x)
# 0.4299226
log(2)/2 + 1/12
# 0.4299069
However, the result diverges as x decreases:
x = 1E-4
(-log(1 - cos(x)) - 1/(cos(x)-1)) / 2 - 1/(x^2) + log(x)
# 0.9543207
# correct: 0
t; [1] "a" "bc" "," "def" "," "adef" "," "x" ";"
> [10] "," "," "gh"
>
> I certainly would *not* claim that it is in any way superior to
>
as
text using standard overkill tools:
read.table(text="a bc,def, adef ,,gh", sep=",")
V1 V2 V3 V4 V5
1 a bc def adef NA gh
The above is a vector of texts. But if you simply want to reassemble your
initial string cleaned up a bit, you can use paste to put back com
hree!"
>
> The bug report includes the comment
> It may be possible that strsplit is not using the startoffset argument
> to pcre_exec
>
>pcre/pcre/doc/html/pcreapi.html
> A non-zero starting offset is useful when searching for another match
> in the same s
Dear R-Users,
I tried the following 3 Regex expressions in R 4.3:
strsplit("a bc,def, adef ,,gh", " |(?=,)|(?<=,)(?![ ])", perl=T)
# "a" "bc" "," "def" "," "" "adef" "," "," "gh"
strsplit("a bc,def, adef ,,gh", " |(?- the first one could also return "", "," (but probably not;
uded in the expanded Regex expression:
tokens = strsplit(str, "(?<=[-+\u2010-\u2014])\\s++", perl=TRUE)
Sincerely,
Leonard
On 4/13/2023 9:40 PM, Leonard Mada wrote:
Dear Emily,
Using a look-behind solves the split problem in this case. (Note:
Using Regex is in most/many c
Dear Emily,
Using a look-behind solves the split problem in this case. (Note: Using
Regex is in most/many cases the simplest solution.)
str = c("leucocyten + gramnegatieve staven +++ grampositieve staven ++",
"leucocyten – grampositieve coccen +")
tokens = strsplit(str, "(?<=[-+])\\s++", perl
(.S3methods(print))
> [1] 206
>
> There may be better ways, but this is what came to my mind.
> -- Bert
>
> On Wed, Mar 8, 2023 at 11:09 AM Leonard Mada via R-help
> wrote:
>
> Dear R-Users,
>
> I want to change the args() function to return by default
quot;.default")
name = fn
}
.Internal(args(name))
}
r/
Gregg
--- Original Message ---
On Wednesday, March 8th, 2023 at 12:09 PM, Leonard Mada via R-help
wrote:
Dear R-Users,
I want to change the args() function to return by default the arguments
of the default generic function:
arg
Dear R-Users,
I want to change the args() function to return by default the arguments
of the default generic function:
args = function(name, default = TRUE) {
# TODO: && is.function.generic();
if(default) {
fn = match.call()[[2]];
fn = paste0(as.character(fn), ".default"
Dear R-Users,
I noticed that *read* is not a generic function. Although it could
benefit from the functionality available for generic functions:
read = function(file, ...) UseMethod("read")
methods(read)
# [1] read.csv read.csv2 read.dcf read.delim read.delim2
read.DIF read.
Dear R-Users,
Did anyone follow more closely the SARS Cov-2 lineages?
I have done a quick check of Cov-2 mutations on the list downloaded from
NCBI (see GitHub page below); but it seems that the list contains the
cumulative mutations only for B.1 => B.1.1, but not after the B.1.1 branch:
# B.
Dear Ivan,
Thank you very much.
Indeed, I missed the download button. The csv file seems to contain all
the mutations in a usable format.
Sincerely,
Leonard
On 1/24/2023 11:29 PM, Ivan Krylov wrote:
On Tue, 24 Jan 2023 22:26:34 +0200
Leonard Mada via R-help wrote:
The data on the
Dear R-Users,
1.) Is there a package which gives the full code of a Covid-19
lineage/variant?
E.g. Omicron = B.1.1.529, while BA correspond to specific subtypes of
Omicron:
BA.x:
BA.1 = B.1.1.529.1;
BA.1.1 = B.1.1.529.1.1;
BA.1.1.5 = B.1.1.529.1.1.5;
Is there any package to offer such trans
0[1] = 1E-6;
x = multiroot(solve.AcidSpecies, x0, H = 4E-8)
print(x)
# Results:
# atp adp pi pcr cr lactate
# 4.977576e-04 3.254998e-06 5.581774e-08 4.142785e-09 5.011807e-10
4.973691e-03
Sincerely,
Leonard
On 1/23/2023 2:24 AM, Leonard Mada wrote:
>
cr = 0.004,
lactate = 0.005
) / 3;
# tricky to get a positive value !!!
x0[1] = 0.001; # still NOT positive;
x = multiroot(solve.AcidSpecies, x0, H = 4E-8)
On 1/23/2023 12:37 AM, Leonard Mada wrote:
> Dear Troels,
>
> The system that you mentioned needs to be transformed first. The
> equa
Dear Akshay,
The best response was given by Andrew. "{...}" is not a closure.
This is unusual for someone used to C-type languages. But I will try to
explain some of the rationale.
In the case that "{...}" was a closure, then external variables would
need to be explicitly declared before the
Dear List-Members,
I encounter a problem while trying to integrate the following function:
integrate(function(x) x^3 / sin(x), -pi/2, pi/2)
# Error in integrate(function(x) x^3/sin(x), -pi/2, pi/2) :
# non-finite function value
# the value should be finite:
curve(x^3 / sin(x), -pi/2, pi/2)
int
Dear Terry,
The following approach may be more suitable:
fits <- lapply(argument, function)
fits.df = do.call(rbind, fits);
It works if all the lists returned by "function" have the same number of
elements.
Example:
fits.df = lapply(seq(3), function(id) {
list(
beta = rnorm(1)
Dear R-Users,
Hidden Problems with Clustering Algorithms
I stumbled recently upon a presentation about hierarchical clustering.
Unfortunately, it contains a hidden problem of clustering algorithms.
The problem is deeper and I think that it warrants a closer inspection
by the statistical commu
paragraphs, I would usually do something like:
strwrap(x = , width = 80, indent = 4)
On Fri, Oct 28, 2022 at 5:42 PM Leonard Mada via R-help
wrote:
Dear R-Users,
text = "
What is the best way to split/cut a vector of strings into lines of
preferred width?
I have come up with a simple sol
Dear R-Users,
text = "
What is the best way to split/cut a vector of strings into lines of
preferred width?
I have come up with a simple solution, albeit naive, as it involves many
arithmetic divisions.
I have an alternative idea which avoids this problem.
But I may miss some existing function
Dear R Users,
I have written some R code for multivariate polynomials in R. I am
looking forward for some help in redesigning and improving the code.
Although this code was not planned initially to be released as a
package, the functionality has become quite versatile over time. I will
provi
; Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Wed, May 18, 2022 at 5:08 PM Leonard Mada via R-help
> wro
else to say, have you tried it again
since?
Regards,
Andrew Simmons
On Wed, May 18, 2022 at 5:09 PM Leonard Mada via R-help
wrote:
Dear R Users,
I have run the following command in R:
# x = larger vector of strings (1200 Pubmed abstracts);
# patt = not defined;
npos = regexpr(patt,
Dear R Users,
I have run the following command in R:
# x = larger vector of strings (1200 Pubmed abstracts);
# patt = not defined;
npos = regexpr(patt, x, perl=TRUE);
# Error in regexpr(patt, x, perl = TRUE) : object 'patt' not found
The problem:
R becomes unresponsive and it takes 1-2 minut
Dear Marna,
If you want to extract the middle of those intervals, please find below
an improved variant of Luigi's code.
Note:
- it is more efficient to process the levels of a factor, instead of all
the individual strings;
- I envision that there are benefits in a large data frame (> 1 mil
o:
tbl = table(cumEvent);
# to be on the safe side (as the cumsum is increasing):
id = order(as.numeric(names(tbl)));
tbl = tbl[id];
Hope this helps,
Leonard
On 1/14/2022 3:30 AM, Leonard Mada wrote:
Dear Jeff,
My answer is a little bit late, but I hope it helps.
jrdf = read.table(text=&qu
Dear Jeff,
My answer is a little bit late, but I hope it helps.
jrdf = read.table(text="Time Event_AEvent_B Lag_B
1 1 10
2 0 11
3 0 00
4 1 00
5 0 11
6 0
Dear Miluji,
something like this could help:
sapply(tapply(x$Value, x$ID, cumsum),
function(x) x[seq(4, length(x), by=4)] - c(0, x[head(seq(4,
length(x), by=4), -1)]))
1.) Step 1:
Compute the cumsum for each ID:
tapply(x$Value, x$ID, cumsum)
2.) Step 2:
- iterate over the resulting
person_names
The next method implemented is often the [ (single bracket subset) function;
this is relatively complicated to get right, but worth exploring.
I hope that gets you a little further along the road.
Martin Morgan
On 11/16/21, 11:34 PM, "R-help on behalf of Leonard Mada via R-help&q
Dear List-Members,
I want to create an S4 class with 2 data slots, as well as a plot and a
line method.
Unfortunately I lack any experience with S4 classes. I have put together
some working code - but I presume that it is not the best way to do it.
The actual code is also available on Gith
Dear List-members,
I would like to experiment with dispatching on 2 arguments and have a
few questions.
p1 = data.frame(x=1:3, coeff=1)
class(p1) = c("pm", class(p1));
I want to replace variables in a polynomial with either:
another polynomial, or another variable (character) or with a spec
uld suggest making your class through the methods
> package, with methods::setClass("pm", ...)
> See the documentation for setClass for more details, it's the
> recommended way to define classes in R.
>
> On Wed, Nov 3, 2021 at 2:36 PM Leonard Mada via R-help
>
Dear List members,
Is there a way to access the default names() function?
I tried the following:
# Multi-variable polynomial
p = data.frame(x=1:3, coeff=1)
class(p) = c("pm", class(p));
names.pm = function(p) {
# .Primitive("names")(p) # does NOT function
# .Internal("names")(p) # does NO
possible
to run sapply on the filtered sequence (but I did not want to break
anything now).
Sincerely,
Leonard
On 10/9/2021 9:26 PM, Leonard Mada wrote:
Dear Ravi,
I wrote a small replacement for ifelse() which avoids such unnecessary
evaluations (it bothered me a few times as well
Dear Ravi,
I wrote a small replacement for ifelse() which avoids such unnecessary
evaluations (it bothered me a few times as well - so I decided to try a
small replacement).
### Example:
x = 1:10
FUN = list();
FUN[[1]] = function(x, y) x*y;
FUN[[2]] = function(x, y) x^2;
FUN[[3]] = function
Dear R Users,
I wrote a minimal parser to extract strings and comments from the
function definitions.
The string extraction works fine. But there are no comments:
a.) Are the comments stripped from the compiled packages?
b.) Alternatively: Is the deparse() not suited for this task?
b.2.)
, Leonard Mada wrote:
> Dear R Users,
>
>
> I have started to compile some useful hacks for the generation of nice
> descriptive statistics. I hope that these functions & hacks are useful
> to the wider R community. I hope that package developers also get some
> inspirat
Dear R Users,
I have started to compile some useful hacks for the generation of nice
descriptive statistics. I hope that these functions & hacks are useful
to the wider R community. I hope that package developers also get some
inspiration from the code or from these ideas.
I have started t
any packages that do such
> a thing.
> If such a thing exists in another language, there's probably an R
> package
> with a similar name containing ports of such functions, that might
> be your
> best bet. I hope this helps.
>
> On Tue, Sep
eonard
On 9/29/2021 6:30 AM, Andrew Simmons wrote:
> I think what you're looking for is 'strwrap', it's in package base.
>
> On Tue, Sep 28, 2021, 22:26 Leonard Mada via R-help
> mailto:r-help@r-project.org>> wrote:
>
> Dear R-Users,
>
>
&
Dear R-Users,
Does anyone know any package or library that implements functions for
word wrapping?
I did implement a very rudimentary one (Github link below), but would
like to avoid to reinvent the wheel. Considering that word-wrapping is a
very common task, it should be available even in b
On 9/27/2021 1:06 AM, Leonard Mada wrote:
>
> Dear Bill,
>
>
> Does list.files() always sort the results?
>
> It seems so. The option: full.names = FALSE does not have any effect:
> the results seem always sorted.
>
>
> Maybe it is better to process the files i
dir(R.home("library"),recursive=TRUE))
> [1] 12949
>
> On Sat, Sep 25, 2021 at 8:12 AM Leonard Mada via R-help
> mailto:r-help@r-project.org>> wrote:
>
> Dear List Members,
>
>
> I tried to compute the file sizes of each installed package and the
.home("library")))
user system elapsed
0.351.101.43
identical(L1,L2)
[1] TRUE
length(L1)
[1] 30
length(dir(R.home("library"),recursive=TRUE))
[1] 12949
On Sat, Sep 25, 2021 at 8:12 AM Leonard Mada via R-help <
r-help@r-project.org> wrote:
Dear List
Dear List Members,
I tried to compute the file sizes of each installed package and the
process is terribly slow.
It took ~ 10 minutes for 512 packages / 1.6 GB total size of files.
1.) Package Sizes
system.time({
x = size.pkg(file=NULL);
})
# elapsed time: 509 s !!!
# 512 Packages
[working version]
On 9/25/2021 2:55 AM, Leonard Mada wrote:
Dear List Members,
Is there a way to extract if an installed package is from Bioconductor
or if it is a regular Cran package?
The information seems to be *not* available in:
installed.packages()
### [updated]
# Basic Info
Dear Bert,
Indeed, this seems to work:
installed.packages(fields="Repository")
I still need to figure out what variants to expect.
Sincerely,
Leonard
On 9/25/2021 3:31 AM, Leonard Mada wrote:
Dear Bert,
The DESCRIPTION file contains additional useful information, e.g.:
1
n Fri, Sep 24, 2021 at 4:56 PM Leonard Mada via R-help
wrote:
Dear List Members,
Is there a way to extract if an installed package is from Bioconductor
or if it is a regular Cran package?
The information seems to be *not* available in:
installed.packages()
Sincerely,
Leonard
===
I
Dear List Members,
Is there a way to extract if an installed package is from Bioconductor
or if it is a regular Cran package?
The information seems to be *not* available in:
installed.packages()
Sincerely,
Leonard
===
I started to write some utility functions to analyse installed
Dear R users,
I have started to work on an improved version of the format.ftable
function. The code and ideas should be reused to improve other R
functions (enabling more advanced format of the character output).
However, there are a number of open questions. These are focused on
standardiz
4)
> data.frame(
> cut(x, breaks1, right = FALSE, i = TRUE),
> cut(x, breaks2, right = FALSE, i = TRUE),
> check.names = FALSE
> )
>
>
> I hope this helps.
>
> On Fri, Sep 17, 2021 at 6:26 PM Leonard Mada <mailto:leo.m...@syonic.eu>> wrote:
>
>
are a lot of ways to
introduce NAs... in real projects all analysts should be suspecting this problem.
On September 17, 2021 3:01:35 PM PDT, Leonard Mada via R-help
wrote:
Thank you Andrew.
Is there any reason not to make: include.lowest = TRUE the default?
Regarding the NA:
The user st
seq.int <http://seq.int>(0, 16, 4)
> breaks2 <- seq.int <http://seq.int>(0, 20, 4)
> data.frame(
> cut(x, breaks1, right = FALSE, i = TRUE),
> cut(x, breaks2, right = FALSE, i = TRUE),
> check.names = FALSE
> )
>
>
> I hope this helps.
>
> On
> [8, 12)
> [12, 16)
> [16, 20]
>
>
> so you can see where the inconsistent behaviour comes from. You might
> be able to get R-core to add argument 'warn', but probably not to
> change the default of 'include.lowest'. I hope this helps
>
>
> On
your own.
> Might be worth pitching to R-bugs on the wishlist.
>
>
>
> On Fri, Sep 17, 2021, 17:45 Leonard Mada via R-help
> mailto:r-help@r-project.org>> wrote:
>
> Hello List members,
>
>
> the following improvements would be useful for function cut (
Hello List members,
the following improvements would be useful for function cut (and .bincode):
1.) Argument: Include extremes
extremes = TRUE
if(right == FALSE) {
# include also right for last interval;
} else {
# include also left for first interval;
}
2.) Argument: warn = TRUE
Warn
ep=" ")
ftable2(ftbl, sep=" | ")
ftable2(ftbl, sep=" | ", justify="left")
ftable2(ftbl, sep=" | ", justify="cent") # TODO: center vs centre
ftable2(ftbl, sep=" | ", justify="left", justify.lvl="c")
Sincerely,
Leona
/blob/master/Stat/Tools.Data.R
It makes sense to have such functionality in base R as well: it may be
useful in various locations to format character output.
Sincerely,
Leonard
On 9/14/2021 8:18 PM, Leonard Mada wrote:
Dear List members,
I wrote some code to split long names in
le,
>
> y <- `names<-`(x, value = c("some names"))
>
> now y will be equivalent to x if we did
>
> names(x) <- c("some names")
>
> except that the first will not update x, it will still have its old names.
>
> On Mon, Sep 13, 2021 at 4:33 PM
Dear List members,
I wrote some code to split long names in format.ftable. I hope it will
be useful to others as well.
Ideally, this code should be implemented natively in R. I will provide
in the 2nd part of the mail a concept how to actually implement the code
in R. This may be interesti
Hello Nevil,
you could test something like:
# the Matrix
m = matrix(1:1000, ncol=10)
m = t(m)
# Extract Data
idcol = sample(seq(100), 100, TRUE); # now columns
for(i in 1:100) {
m2 = m[ , idcol];
}
m2 = t(m2); # transpose back
It may be faster, although I did not benchmark it.
There m
and call directly:
'names<-'(x, value);
Leonard
>
> On Mon, Sep 13, 2021, 16:18 Leonard Mada <mailto:leo.m...@syonic.eu>> wrote:
>
> Hello,
>
>
> I have found the evaluation: it is described in the section on
> subsetting. The for
Hello,
I have found the evaluation: it is described in the section on
subsetting. The forced evaluation makes sense for subsetting.
On 9/13/2021 9:42 PM, Leonard Mada wrote:
>
> Hello Andrew,
>
>
> I try now to understand the evaluation of the expression:
>
> e =
t;
>
> match.which <- function (which)
> match.arg(which, c("bottom", "left", "top", "right"), several.ok = TRUE)
>
>
> padding <- function (x, which)
> {
> which <- match.which(which)
> # more code
> }
>
>
value)
> {
> which <- match.arg(which, c("bottom", "left", "top", "right"),
> several.ok = TRUE)
> # code to pad to each side here
> }
>
> Then you could use it like
>
> df <- data.frame(x=1:5, y = sample(1:5, 5))
> padd
and capture the expression: "right(...)"?
2.) Unexpected
'padding<-' was also called!
I did not know this. Is it feature or bug?
R 4.0.4
Sincerely,
Leonard
On 9/13/2021 4:45 PM, Duncan Murdoch wrote:
On 13/09/2021 9:38 a.m., Leonard Mada wrote:
Hello,
I can inc
so depends if I can properly capture the unevaluated expression
inside "right<-":
'right<-' = function(x, val) {
# x is automatically evaluated when using 'f<-'!
# but not when implementing as '%f%' = function(x, y);
}
Many thanks,
Leonard
How can I avoid evaluation?
right = function(x, val) {print("Right");};
padding = function(x) {print("Padding");};
df = data.frame(x=1:5, y = sample(1:5, 5));
### OK
'%=%' = function(x, val) {
x = substitute(x);
}
right(padding(df)) %=% 1; # but ugly
### Does NOT work
'right<-' = function(x
Dear R Help List,
I have the following data set:
eg.
1, date11, f1
1, date12, f2
1, date13, f3
[...]
2, date21, fi
2, date22, fj
[…]
f1 – fn are various levels of a factor variable.
Each ID may contain 1 to many entries. These represent basically semantic data
(triplets).
I want to construc
Hello Johannes,
Johannes Hüsing wrote:
Leonard Mada [Sun, May 04, 2008 at 07:26:04PM CEST]:
> Dear list members,
>
> Every "modern" OS comes with dozens of useless fonts, so that the
> current font drop-down list in most programs is overcrowded with fonts
> one ne
d have access to) mathlab, I am rather confined to
R. Which is not bad, but I need a lot of help to accomplish this task.
Any help is highly appreciated.
Sincerely,
Leonard Mada
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listin
91 matches
Mail list logo