20 a 105.4257 145.2059 20 b 166.4094 233.7112 20 c
Le 16/06/2024 à 20:54, Gabor Grothendieck a écrit :
> 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))
>
>
.
>> Just for comparison, in python, things like comprehensions for list or
> dictionaries or tuples often are syntactic sugar and the interpreter may
> simply rewrite them more like the first program you typed and evaluates
> that. The comprehensions are more designed for users wh
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
p On Behalf Of Bert Gunter
Sent: Friday, May 24, 2024 6:52 PM
To: Laurent Rhelp
Cc: r-help@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.
I
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
Le 21/05/2024 à 12:15, Ivan Krylov a écrit :
> В Tue, 21 May 2024 11:29:33 +0200
> Laurent Rhelp пишет:
>
>> pos <- seek(con_in,2,origin="start")
>> # We have to repeat the command to return the good amount of read
>> # bytes
>> print(paste0("po
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
I answer to myself: I have to generate my signal up to f1 = Fs/2 in
order to have a flat response over the entire frequency range.
Le 09/04/2024 à 19:48, laurentRhelp a écrit :
Dear RHelp-list,
I generate a swept sine signal using the signal library. I can see
using the spec.pgram command
ls on the right as well, you will just need
to uncomment the line
ans$right <- TRUE
in your my_yscale.components.subticks function.
-Deepayan
On Tue, May 30, 2023 at 12:39 AM Laurent Rhelp wrote:
Dear R-Help-list,
I want to display many sensors on the same page so I
Dear R-Help-list,
I want to display many sensors on the same page so I have to adapt
the size of the y-axis labels and I woul like to adapt the number of
ticks according to the sensor. I use the yscale.components argument with
the function yscale.components.subticks: see the code below.
It is great !
I had not thought to use the value 0 for the variables style1 and
style2. I did not well understand when reading the documentation.
Thank you
Laurent
Le 13/02/2023 à 19:04, Deepayan Sarkar a écrit :
On Mon, Feb 13, 2023 at 3:48 AM Laurent Rhelp wrote:
Dear R-Help-list,
I
Dear R-Help-list,
I want to use the doubleYScale function from latticeExtra to overlap two
lattice graphs (cf. code below). The overlapping works but I lose the
groups of
every lattice, there are only two colors. Reading the documentation,
the arguments style1 and style2 give me the
, the labels do not
appear on the y-axis if I keep ylim = c(0,max(lim)). But nevermind
because your solution to use prepanel works very well and I will think
next time to use prepanel.
Best regards
L.
Le 22/01/2023 à 18:43, Deepayan Sarkar a écrit :
>
>
> On Sun, Jan 22, 2023 at 6:48 PM Laur
Dear RHelp-list,
I want to choice my scale for every panel in a lattice graph according to
the ylim range of every panel, with 10 ticks and with a start from 0.
Also I want to plot a grid
according to the y ticks (I did that in the panel argument with the
panel.abline function) .
So I
Thank you very much Deepayan, I will see the help of panel.bwplot.
Best regards
L.
Le 11/12/2022 à 18:53, Deepayan Sarkar a écrit :
On Sun, Dec 11, 2022 at 11:05 PM Laurent Rhelp wrote:
Excellent, it works.
But, may you please explain me how xyplot knows that it has to apply
panel.bwplot
.
Le 11/12/2022 à 17:48, Deepayan Sarkar a écrit :
On Sun, Dec 11, 2022 at 2:33 PM Laurent Rhelp wrote:
I understand the idea but I did not succeed.
Here is what I tried:
## 1.middles of classes calculation
m <- tapply(DF$x, groups, mean)
## 2. create a new factor colu
om
> , y = list(log=T, tck = c(1,0))
> , x = list(at = 1:5, tck = 1)
> )
>
> If this is not what you meant, you'll need to clarify ... or just move on.
>
> -- Bert
>
> On Sun, Dec 11, 2022 at 1:06 AM Laurent Rhelp
> wrote:
>
>
is the box
> widths,
> which panel.bwplot() will not know how to compute.
>
> See if the following gives you a reasonable starting point:
>
> DF <- within(DF, m <- tapply(y, groups, mean))
> xyplot(y ~ m, DF, scales = list(log = TRUE
in(DF, m <- tapply(y, groups, mean))
xyplot(y ~ m, DF, scales = list(log = TRUE),
panel = panel.bwplot, horizontal = FALSE,
box.width = .0001)
Best,
-Deepayan
On Sat, Dec 10, 2022 at 7:46 PM Laurent Rhelp wrote:
Dear R-Help list,
I would like to use bwplot from the lat
Dear R-Help list,
I would like to use bwplot from the lattice package with a log scale
both on
the x-axis and the y-axis but I do not know how to do that because I do
not know
how to change the factor x-axis in a numeric x-axis.
Here is my example:
library(lattice)
# the mock data
y
Very effective solution, I hope I remember that for the nex time.
Thank you
Le 09/07/2021 à 19:50, David Winsemius a écrit :
On 7/9/21 10:40 AM, Laurent Rhelp wrote:
Dear R-Help-list,
I have a list init_l containing 16 dataframes and I want to create
a matrix 4 x 4 from this list
,"X2","X3","X4")))
> It doesn't give exactly what your code does, but your code introduces
> an extra level of "list", which you may not want.
>
> -Bill
>
> On Fri, Jul 9, 2021 at 10:40 AM Laurent Rhelp <mailto:laurentrh...@free.f
Dear R-Help-list,
I have a list init_l containing 16 dataframes and I want to create a
matrix 4 x 4 from this list with a dataframe in every cell of the
matrix. I succeeded to do that but my loop is very uggly (cf. below).
Could somebody help me to write nice R code to do this loop ?
It is good trick and we have to know that R arrays use the 'column major
mode' to store the value.
Thank you
Laurent
Le 05/07/2021 à 19:03, David Winsemius a écrit :
On Jul 5, 2021, at 7:56 AM, Laurent Rhelp wrote:
Dear R-Help,
I have an array x made up of three matrices of 5 rows and 3
[i,,])$d ))
HTH,
Eric
On Mon, Jul 5, 2021 at 5:56 PM Laurent Rhelp
wrote:
Dear R-Help,
I have an array x made up of three matrices of 5 rows and 3 columns
of
complex numbers (the complex numbers are not the problem)
## my array
x <- structure(c(5.6196790161893828+0i, 5.7565523942393364
ope this helps!
>
> On Mon, Jul 5, 2021 at 10:56 AM Laurent Rhelp <mailto:laurentrh...@free.fr>> wrote:
>
> Dear R-Help,
>
> I have an array x made up of three matrices of 5 rows and 3
> columns of
> complex numbers (the complex numbers are not the prob
= FALSE)
>
> seems to work well for me. I hope this helps!
>
> On Mon, Jul 5, 2021 at 10:56 AM Laurent Rhelp <mailto:laurentrh...@free.fr>> wrote:
>
> Dear R-Help,
>
> I have an array x made up of three matrices of 5 rows and 3
> columns of
( svd(x[i,,])$d ))
>
> HTH,
> Eric
>
> On Mon, Jul 5, 2021 at 5:56 PM Laurent Rhelp <mailto:laurentrh...@free.fr>> wrote:
>
> Dear R-Help,
>
> I have an array x made up of three matrices of 5 rows and 3
> columns of
> complex numbers (the complex
Dear R-Help,
I have an array x made up of three matrices of 5 rows and 3 columns of
complex numbers (the complex numbers are not the problem)
## my array
x <- structure(c(5.6196790161893828+0i, 5.7565523942393364+0i,
8.5242834298729342+0i,
10.304766710160479+0i,
lt;- as.POSIXlt(time(DF.w))$sec
# now run plot or xyplot as before
On Mon, Feb 22, 2021 at 11:56 AM Gabor Grothendieck
wrote:
I assume that this is a lattice problem. Replacing xyplot with plot
and using all the same arguments there is no error.
On Mon, Feb 22, 2021 at 11:26 AM Laurent Rhelp w
o suppress the X axis and then issue
an axis command. plot.zoo has examples.
On Mon, Feb 22, 2021 at 12:14 PM Laurent Rhelp wrote:
You are right, if I replace xyplot by plot there is no error message but
the POSIXct format is not taken into account for the labels on the
x-axis. Do I have to wri
Le 22/02/2021 à 18:01, Deepayan Sarkar a écrit :
On Mon, Feb 22, 2021 at 9:56 PM Laurent Rhelp wrote:
Dear R-Help-List,
I have to process time series with a sampling frequency of 1 MHz.
I use the POSIXct format for the date-times with microsecond in a zoo
object and the xyplot.zoo
Dear R-Help-List,
I have to process time series with a sampling frequency of 1 MHz.
I use the POSIXct format for the date-times with microsecond in a zoo
object and the xyplot.zoo function to do the graphs.
As I show in the below example I had a trouble to plot the labels on the
x-axis with
;,"","","","","","",""), flush=TRUE, multi.line=FALSE,
skip=nextElem(iter_index1)-1, nlines=1, quiet=TRUE))
[1] "N163" "-0.054023" "-0.049345" "-0.037158" "-0.04112"
"-0.044612
n = TRUE, ignore.stderr = FALSE))
[1] """"""
"你好 Chinese"
[5] "こんにちは Japanese" "مرحبا Arabic""Привет Russian"
[special thanks to Brad Gilbert, Joseph Brenner and others on the
p
Laurent Rhelp wrote:
# sensors to keep
sensors <- c("N053", "N163")
# filter on the beginning of the line
i <- pipe("grep -E '^(N053|N163)' test.txt")
# or:
# filter on the beginning of the given column
# (use $2 for the second column, etc.)
i <- pipe(
;,"","","","","","",""), flush=TRUE, multi.line=FALSE,
skip=nextElem(iter_index1)-1, nlines=1, quiet=TRUE))
[1] "N163" "-0.054023" "-0.049345" "-0.037158" "-0.04112"
"-0.044612
;","","","","",""),
flush=TRUE, multi.line=FALSE, skip=nextElem(iter_index1)-1, nlines=1, quiet=TRUE))
[1] "N163" "-0.054023" "-0.049345" "-0.037158" "-0.04112"
"-0.044612" &quo
4
5 N163 -0.054023 -0.049345 -0.037158 -0.041120 -0.044612 -0.036953
-0.036061 -0.044516 -0.046436
Best, Bill.
W. Michels, Ph.D.
On Sun, May 17, 2020 at 5:43 PM Laurent Rhelp wrote:
Dear R-Help List,
I would like to use an iterator to read a file filtering some
selected lines according to the
4
5 N163 -0.054023 -0.049345 -0.037158 -0.041120 -0.044612 -0.036953
-0.036061 -0.044516 -0.046436
Best, Bill.
W. Michels, Ph.D.
On Sun, May 17, 2020 at 5:43 PM Laurent Rhelp wrote:
Dear R-Help List,
I would like to use an iterator to read a file filtering some
selected lines according to the
Dear R-Help List,
I would like to use an iterator to read a file filtering some
selected lines according to the line name in order to use after a
foreach loop. I wanted to use the checkFunc argument as the following
example found on internet to select only prime numbers :
|
, Jun 22, 2014 at 2:09 PM, Laurent Rhelp laurentrh...@free.fr wrote:
Le 20/06/2014 21:50, Christoph Scherber a écrit :
Dear Laurent
for numeric x variables, you could try jitter:
xyplot(y~jitter(x,0.5))
Cheers
Christoph
Am 20.06.2014 21:45, schrieb Laurent Rhelp:
Hi,
I like to use
Le 20/06/2014 21:50, Christoph Scherber a écrit :
Dear Laurent
for numeric x variables, you could try jitter:
xyplot(y~jitter(x,0.5))
Cheers
Christoph
Am 20.06.2014 21:45, schrieb Laurent Rhelp:
Hi,
I like to use with xyplot (package lattice) the groups argument and
superpose.symbol
Hi,
I like to use with xyplot (package lattice) the groups argument and
superpose.symbol to compare several curves. But, when there are a great
many points, the symbols are very close and the graph becomes
unreadable. Would there be an argument or a tip not to draw all the
symbols, for
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
Le 07/05/2011 06:17, Penny Bilton a écrit :
I am trying to find a confidence band for a fitted non-linear curve. I
see that the predict.nls function has an interval argument, but a
previous post indicates that this argument has not been implemented.
Is this still true? I have tried various
Dear R-List,
I try to use accented chars in a plot using odfWeave (see the example
below). I found the solution using the iconv command to write the
accented char é. But, is somebody know another solution not to have to
use iconv command every time ?
Thanks
Example :
plot,fig=TRUE=
Le 25/03/2010 20:28, Laurent Rhelp a écrit :
Dear R-List,
I am working with binary data that I want to store in a PostgreSQL
DataBase. I decided to use a TXT field. I read my binary file with
readBin function, I succeed in my data storage in the database but I
have some trouble to extract
Dear R-List,
I am working with binary data that I want to store in a PostgreSQL
DataBase. I decided to use a TXT field. I read my binary file with
readBin function, I succeed in my data storage in the database but I
have some trouble to extract the data : the correct amount of bytes is
Dear R-List,
I have the habit of using R for my data processing and I like to use
the power of the lattice package. Presently, I have to manage time
series. So, in order to work properly I want to discover the zoo package
and the related methods (since lattice can work with zoo class). But
, 2010 at 8:25 AM, Laurent Rhelp laurentrh...@free.fr wrote:
Dear R-List,
I have the habit of using R for my data processing and I like to use the
power of the lattice package. Presently, I have to manage time series. So,
in order to work properly I want to discover the zoo package
identical(x,y)
[1] FALSE
y - x+.001 # 0.1 us
identical(x,y)
[1] TRUE
On Sat, Feb 6, 2010 at 9:41 AM, Laurent Rhelp laurentrh...@free.fr wrote:
Gabor Grothendieck a écrit :
zoo is independent of time and date class so it does not restrict your
choice of index class
David Kane a écrit :
I have a pdf file that I would like to parse into R:
http://www.williams.edu/Registrar/geninfo/faculty.pdf
For now, I open the file in Acrobat by hand, then save it as text
and then use readLines(). That works fine but a) I am concerned that
some information may be lost
53 matches
Mail list logo