Displaying 13 results from an estimated 13 matches for "laurentrhelp".
2024 May 25
1
dplyr, group_by and selective action according to each group
...ays to approach the problem somewhat from outside after grouping so you can apply your function to the subset of the rows you want.
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Bert Gunter
Sent: Friday, May 24, 2024 6:52 PM
To: Laurent Rhelp <laurentRHelp at free.fr>
Cc: r-help at r-project.org
Subject: Re: [R] dplyr, group_by and selective action according to each group
Laurent:
As I don't use dplyr, this won't help you, but I hope you and others may
find it entertaining anyway.
If I understand you correctly (and ignore this if I have...
2024 May 21
1
wrtiteBin in conjunction with seek : the position in the file is not good when writing
? Tue, 21 May 2024 11:29:33 +0200
Laurent Rhelp <laurentRHelp at free.fr> ?????:
> pos <- seek(con_in,2,origin="start")
> # We have to repeat the command to return the good amount of read
> # bytes
> print(paste0("pos is not equal to 2, pos = ",pos))
That's because seek() returns the previous position ("before...
2024 May 24
1
dplyr, group_by and selective action according to each group
...ther "variables" . So funcs[[nm]](whatever) seems to
me to be a natural way to choose and call the function you want. You may
disagree, of course.
Caveat: I make no claims about the efficiency or lack thereof of the above.
Cheers,
Bert
On Fri, May 24, 2024 at 12:35?PM Laurent Rhelp <laurentRHelp at free.fr> wrote:
> Dear RHelp-list,
>
> Using dplyr and the group_by approach on a dataframe, I want to be
> able to apply a specific action according to the group name. The code
> bellow works, but I am not able to write it in a more esthetic way using
> dplyr. Can some...
2024 Jun 16
1
slowness when I use a list comprehension
This can be vectorized. Try
ix <- seq_along(vec2)
S_diff2 <- sapply(seq_len(N1-(N2-1)*ratio_sampling), \(j)
sum((vec1[(ix-1)*ratio_sampling+j] - vec2[ix])**2))
On Sun, Jun 16, 2024 at 11:27?AM Laurent Rhelp <laurentRHelp at free.fr> wrote:
>
> Dear RHelp-list,
>
> I try to use the package comprehenr to replace a for loop by a list
> comprehension.
>
> I wrote the code but I certainly miss something because it is very
> slower compared to the for loops. May you please explain to me w...
2007 Apr 08
0
[Fwd: Re: regular expression]
-------------- section suivante --------------
Une pi?ce jointe a ?t? nettoy?e...
De: Laurent Rhelp <laurentRhelp at free.fr>
Objet: Re: [R] regular expression
Date: Sun, 08 Apr 2007 22:29:49 +0200
Taille: 6478
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070408/9faeeec0/attachment.mht
2007 Apr 06
2
regular expression
Dear R-List,
I have a great many files in a directory and I would like to
replace in every file the character " by the character ' and in the same
time, I have to change ' by '' (i.e. the character ' twice and not the
unique character ") when the character ' is embodied in "....."
So, "....." becomes '.....' and
2024 May 21
1
wrtiteBin in conjunction with seek : the position in the file is not good when writing
Dear RHelp-list,
?I want to write at a specific position in a file without reading all
the file
because it is very large and I cannot read it in my RAM. But I miss
something
about the use of the command writeBin in conjunction with seek. In the
example bellow the seek
commands works well with the readBin command but not with writeBin, the
writeBin
command write from the beginning of the file
2006 Aug 29
2
lattice and several groups
Dear R-list,
I would like to use the lattice library to show several groups on
the same graph. Here's my example :
## the data
f1 <- factor(c("mod1","mod2","mod3"),levels=c("mod1","mod2","mod3"))
f1 <- rep(f1,3)
f2 <-
2024 May 24
1
dplyr, group_by and selective action according to each group
Dear RHelp-list,
?? Using dplyr and the group_by approach on a dataframe, I want to be
able to apply a specific action according to the group name. The code
bellow works, but I am not able to write it in a more esthetic way using
dplyr. Can somebody help me to find a better solution ?
Thank you
Best regards
Laurent
df_test <- data.frame( x1=1:9, x2=1:9,
2024 Jun 16
2
slowness when I use a list comprehension
Dear RHelp-list,
?? I try to use the package comprehenr to replace a for loop by a list
comprehension.
?I wrote the code but I certainly miss something because it is very
slower compared to the for loops. May you please explain to me why the
list comprehension is slower in my case.
Here is my example. I do the calculation of the square difference
between the values of two vectors vec1 and
2010 Jun 21
0
odfWeave accented chars in a plot iconv
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100621/903473c1/attachment.pl>
2013 Jan 12
0
trouble with accentuated characters in \title tag in Rd file
Hi,
I have a weird issue when creating a package with latin1 encoding.
All works fine except the fact that I can't put non-ASCII characters
in the title tag. There is NA in the place of the title in the pdf file
of the documentation.
I can put non-ASCII characters in the other tags (description, details...).
I well verified that I put in the DESCRIPTION file the line :
Encoding:
2006 Mar 05
1
Sweave and long strings
Dear R-List,
I use Sweave (which is wonderful) and I have a problem with the
strings when they are too long according to the width of the page. For
example when I do in my .Rnw document :
<<UsingRODBC,echo=TRUE>>=
channel <- odbcConnect(dsn="database",uid="root",pwd="password")
df1 <- sqlFetch(channel,"table1",rownames=TRUE)
df2