Re: [R] Time series data decomposition from by minute data

2024-10-04 Thread Petr Pikal
Hallo you can extract POSIX object tv <- as.POSIXct(index(dt_train)) and use cut together with aggregate cut(tv, "hour") aggregate(dt_train, list(cut(tv, "hour")), mean) 2014-10-06 21:00:00 9.807692 2014-10-06 22:00:00 8.67 Cheers. Petr čt 3. 10.

Re: [R] Fill NA values in columns with values of another column

2024-08-28 Thread Petr Pikal
s, by.x="X2", by.y="V1") X2 X1 V2 1 1 NA 2 2 1 NA 2 3 1 2 2 4 1 2 2 5 2 NA 7 6 2 NA 7 7 2 7 7 8 2 7 7 9 3 10 10 10 3 NA 10 11 3 10 10 12 3 NA 10 13 4 4 4 14 4 NA 4 15 4 4 4 16 4 NA 4 17 5 9 9 18 5 NA 9 19 5 NA 9 Cheers. Petr

Re: [R] Force conversion of (POSIXct) time zone with base R

2024-08-22 Thread Petr Pikal
Hi what about now <- Sys.time() now [1] "2024-08-22 11:24:23 CEST" now.utc <- as.POSIXct(now, tz = "UTC")+2*3600 now.utc [1] "2024-08-22 11:24:23 UTC" Cheers. Petr čt 22. 8. 2024 v 11:00 odesílatel Iago Giné Vázquez napsal: > Hi, > > How should P

Re: [R] Synthetic Control Method

2024-04-16 Thread Petr Pikal
dataprep call and type of columns should be also same. Cheers. Petr <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Neobsahuje žádné viry.www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_sou

Re: [R] Network issue

2024-02-21 Thread Petr Pikal
Hallo James Just a wild guess, are your problems connected with change of default download method from wininet to libcurl? Cheers Petr út 20. 2. 2024 v 18:24 odesílatel James Powell napsal: > [[alternative HTML version deleted]] __ R-h

Re: [R] Seeking Assistance: Plotting Sea Current Vectors in R

2023-07-25 Thread PIKAL Petr
processing and visualization. ocean: The "ocean" package is designed for oceanographic data analysis and visualization, including sea current data. It offers functions for data manipulation, transformation, and plotting. Cheers Petr -Original Message- From: R-help On Behalf Of

Re: [R] Plotting factors in graph panel

2023-07-07 Thread PIKAL Petr
ggplot(TrialData4, aes(x=Income, y=Percent, group=Measure)) + geom_point() + geom_line() + facet_wrap(~Measure) + theme(axis.text=element_text(size=5)) Should do the trick. S pozdravem | Best Regards RNDr. Petr PIKAL Vedoucí Výzkumu a vývoje | Research Manager PRECHEZA a.s. nábř. Dr. Edvarda

Re: [R] Plotting factors in graph panel

2023-07-06 Thread PIKAL Petr
(~Measure) xyplot(Percent ~ Income | Measure, TrialData4, type = "o", pch = 16, as.table = TRUE, grid = TRUE) So it is probably only matter of your preference which one do you choose. Cheers Petr > -Original Message- > From: R-help On Behalf Of Deepayan Sarkar > S

Re: [R] Plotting factors in graph panel

2023-07-03 Thread PIKAL Petr
Hi I believe that facet_grid his is quite close to what you expect. p <- ggplot(mpg, aes(displ, cty)) + geom_point()+geom_line() p + facet_grid(vars(drv), vars(cyl)) You can inspect how mpg data is organized by head(mpg) Cheers Petr > -Original Message- > From: R-help On

Re: [R] Help/documentation on Rgui

2023-07-03 Thread PIKAL Petr
/Rconsole.html and "Initialization at Start of an R Session" in R help ?Rprofile Cheers Petr > -Original Message- > From: R-help On Behalf Of Iago Giné > Vázquez > Sent: Monday, July 3, 2023 8:36 AM > To: r-help@r-project.org > Subject: [R] Help/documentation on

Re: [R] Plotting factors in graph panel

2023-06-28 Thread PIKAL Petr
ts variable names to fit your needs. Cheers Petr > -Original Message- > From: R-help On Behalf Of Anupam Tyagi > Sent: Thursday, June 29, 2023 5:49 AM > To: r-help@r-project.org > Subject: Re: [R] Plotting factors in graph panel > > Thanks, Pikal and Jim. Yes, it has

Re: [R] horizontal grouped stacked plots and removing space between bars

2023-06-28 Thread PIKAL Petr
), legend.title=element_blank(), > panel.background = element_blank(), axis.title.x = element_blank(), > axis.text.x=element_blank(), axis.ticks.x=element_blank(), > axis.title.y = element_text(angle = 90, hjust = 0.5)) And here I got 2 plots one above the other so I presume this is what

Re: [R] Plotting factors in graph panel

2023-06-28 Thread PIKAL Petr
freely. 3. If I understand correctly you should have an Income column, Percentage column and Category column. If this is the case ggplot(yourdata, aes(x=Income, y=Percentage)) + geom_line() + facet_grid(~Category) should give you what you want. But without data it is hard to say. Cheers Petr

Re: [R] Should help of estimate in t.test be corrected?

2023-04-03 Thread PIKAL Petr
t or two sample paired test" Cheers Petr > -Original Message- > From: Samuel Granjeaud IR/Inserm > Sent: Monday, April 3, 2023 1:25 PM > To: PIKAL Petr ; r-help@r-project.org > Subject: Re: [R] Should help of estimate in t.test be corrected? > > Hi > > Than

Re: [R] Should help of estimate in t.test be corrected?

2023-04-03 Thread PIKAL Petr
Hi You need to use paired option > t.test(x=0:4, y=sample(5:9), paired=TRUE)$estimate mean difference -5 Cheers Petr > -Original Message- > From: R-help On Behalf Of Samuel Granjeaud > IR/Inserm > Sent: Sunday, April 2, 2023 11:39 PM > To: r-help@r-pro

Re: [R] Rprofile.site and automatic installation of missing packages

2023-03-22 Thread PIKAL Petr
for my questions, it is something I never done before but I now need to resolve it in a way which fits to our IT environment. Best regards. Petr -Original Message- From: Duncan Murdoch Sent: Tuesday, March 21, 2023 5:43 PM To: PIKAL Petr ; r-help Subject: Re: [R] Rprofile.site and au

Re: [R] Rprofile.site and automatic installation of missing packages

2023-03-21 Thread PIKAL Petr
ASS) #** test <-(scan("pack.txt", character(), quote = "")) x<- utils::installed.packages() utils::install.packages(test[!test %in% x], repos="https://cloud.r-project.org";) ##** Options are set and working. MASS should be loaded but is not >

Re: [R] Rprofile.site and automatic installation of missing packages

2023-03-21 Thread PIKAL Petr
their .Rprofile to get customised way how to start R. Best regards Petr > -Original Message- > From: Duncan Murdoch > Sent: Tuesday, March 21, 2023 1:55 PM > To: PIKAL Petr ; r-help > Subject: Re: [R] Rprofile.site and automatic installation of missing > packages > &g

[R] Rprofile.site and automatic installation of missing packages

2023-03-21 Thread PIKAL Petr
, perform an installation without user intervention in Windows environment? S pozdravem | Best Regards Petr ggplot2 zoo __ 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

Re: [R] Shaded area

2023-03-01 Thread PIKAL Petr
Hallo Excel attachment is not allowed here, but shading area is answered many times elsewhere. Use something like . "shading area r" in google. See eg. https://www.geeksforgeeks.org/how-to-shade-a-graph-in-r/ Cheers Petr -Original Message- From: R-help On Behalf Of George

Re: [R] identify the distribution of the data

2023-02-08 Thread PIKAL Petr
Hi Others gave you more fundamental answers. To check the possible distribution you could use package https://cran.r-project.org/web/packages/fitdistrplus/index.html Cheers Petr > -Original Message- > From: R-help On Behalf Of Bogdan Tanasa > Sent: Wednesday, February 8, 202

Re: [R] preserve class in apply function

2023-02-07 Thread PIKAL Petr
[7] 0.47044467 0.23914494 0.26504430 0.02037657 Cheers Petr > -Original Message- > From: R-help On Behalf Of Naresh Gurbuxani > Sent: Tuesday, February 7, 2023 1:52 PM > To: r-help@r-project.org > Subject: [R] preserve class in apply function > > > > Consider a data

Re: [R] How to calculate the derivatives at each data point?

2023-01-31 Thread PIKAL Petr
Hi Konstantinos Not exactly derivative but > diff(df[,2]) [1] -0.01 -0.01 -0.01 -0.01 0.00 0.01 -0.02 -0.03 -0.02 May be enaough for you. Cheers Petr > > -Original Message- > From: R-help On Behalf Of konstantinos > christodoulou > Sent: Tuesday, January 31, 202

Re: [R] question

2023-01-30 Thread PIKAL Petr
ke. But without same data sample I may be wrong. Cheers Petr > -Original Message- > From: R-help On Behalf Of Carolyn J Miller via > R-help > Sent: Monday, January 30, 2023 7:16 PM > To: r-help@r-project.org > Subject: [R] question > > Hi guys, > > I a

Re: [R] akima interp results to zero with less than 10 values

2023-01-26 Thread PIKAL Petr
Hallo Duncan Thanks, I was not aware of this package. I will try. Petr > -Original Message- > From: Duncan Murdoch > Sent: Thursday, January 26, 2023 3:44 PM > To: PIKAL Petr ; r-help@r-project.org > Subject: Re: [R] akima interp results to zero with less than 10 value

[R] akima interp results to zero with less than 10 values

2023-01-26 Thread PIKAL Petr
a bug in interp or in the documentation or is it my poor understanding of the whole matter. Best regards Petr __ 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 g

Re: [R] package FactoMineR

2023-01-24 Thread PIKAL Petr
future versions. Probably simple ... in function definition and print(plot(res, axes = axes, ...)) addition could do the trick, but I am not sure. Cheers Petr > -Original Message- > From: R-help On Behalf Of varin sacha via R- > help > Sent: Monday, January 23, 2023 7:38

Re: [R] Printing special characters

2023-01-16 Thread PIKAL Petr
Hallo Dennis Is the STRING in R still containing **≥** character? Or it was converted during reading to R to ...? What dput(STRING) result i? Cheers Petr > -Original Message- > From: R-help On Behalf Of Dennis Fisher > Sent: Monday, January 16, 2023 9:19 AM > To: r-help@r

Re: [R] Reg: ggplot error

2023-01-11 Thread PIKAL Petr
ICUData.neuro as aes value. Compare: ggplot(ICUData.neuro, aes(x=ICUData.neuro$LOS)) + geom_histogram(aes(y=after_stat(density)), binwidth = 5, fill = "darkgrey") with ggplot(ICUData, aes(x=ICUData.neuro$LOS)) + geom_histogram(aes(y=after_stat(density)), binwidth = 5,

Re: [R] Reg: ggplot error

2023-01-11 Thread PIKAL Petr
understand and decipher. So think about simplification and maybe you will find the error source yourself during this simplification. Cheers Petr > -Original Message- > From: R-help On Behalf Of Upananda Pani > Sent: Wednesday, January 11, 2023 1:06 PM > To: Eric Berger > Cc: r-help

Re: [R] Date order question

2023-01-04 Thread PIKAL Petr
annotate("text", x=date[2], y=.8, label="OOC",size=6,fontface="bold")+ annotate("text", x=date[2], y=-.05, label="PT Not Done",size=5,fontface="bold") Cheers Petr > -Original Message- > From: R-help On Behalf Of Thom

Re: [R] R Certification

2023-01-02 Thread PIKAL Petr
Hallo Mukesh R project is not Microsoft or Oracle AFAIK. But if you need some certificate you could take courses on Coursera, they are offering certificates. Cheers Petr > -Original Message- > From: R-help On Behalf Of Mukesh > Ghanshyamdas Lekhrajani via R-help >

Re: [R] if documentation

2022-12-07 Thread PIKAL Petr
Hallo Martin I understand. Anyway, it would not do any harm to add something like x <- 11 if(x < 0) {print("weird")} else if(x >= 0 & x <= 9) { print("too low")} else if (x > 9 & x <= 10) { print("just enough")} else { print("

[R] if documentation

2022-12-06 Thread PIKAL Petr
entry and paragraph about nested if's could be beneficial. if(cond) cons.expr else if (cond) alt.expr else alt2.expr Nested if expressions are better realized with "else if" instead of sequence of plain "else" control statements especially when using s

Re: [R] data frame returned from sapply but vector expected

2022-11-04 Thread PIKAL Petr
Hallo Ivan Thanks, yes it seems to be working. I thought also removing NULL by mylist2[sapply(mylist2, is.null)] <- NULL but your approach is probably better (in any case simpler) Thanks again. Petr > -Original Message- > From: Ivan Krylov > Sent: Friday, November 4,

[R] data frame returned from sapply but vector expected

2022-11-04 Thread PIKAL Petr
ULL $ :'data.frame': 5 obs. of 1 variable: ..$ b: num [1:5] 0.01733 0.46055 0.19421 0.11609 0.00789 $ :'data.frame': 5 obs. of 1 variable: ..$ b: num [1:5] 0.593 0.478 0.299 0.185 0.847 S pozdravem | Best Regards RNDr. Petr PIKAL Vedoucí Výzkumu a vývoje |

Re: [R] Associate a .R file with the RGui

2022-11-04 Thread PIKAL Petr
-customize-the-send-to-menu-in-windows Cheers Petr > -Original Message- > From: R-help On Behalf Of Andrew Simmons > Sent: Friday, November 4, 2022 10:09 AM > To: Amarjit Chandhial > Cc: R-help Mailing List > Subject: Re: [R] Associate a .R file with the RGui > > I

Re: [R] Ids with matching number combinations?

2022-10-07 Thread PIKAL Petr
ous answer. Cheers Petr > -Original Message- > From: R-help On Behalf Of Marine Andersson > Sent: Friday, October 7, 2022 1:58 PM > To: r-help@r-project.org > Subject: [R] Ids with matching number combinations? > > Hi, > > If I have two datasets like this: &g

Re: [R] R version 4.2.1 install.packages does not work with IE proxy setting

2022-10-06 Thread PIKAL Petr
Hallo Howard Thanks, for the time being the previous workaround with wininet options works for me. I will wait for the new R version and then try to persuade our IT to make relevant changes. Cheers Petr > -Original Message- > From: Howard, Tim G (DEC) > Sent: Thursday, Octobe

Re: [R] R version 4.2.1 install.packages does not work with IE proxy setting

2022-10-05 Thread PIKAL Petr
Thanks, the workaround works but we need try the "permanent" solution with Renviron.site file in future. Cheers Petr > -Original Message- > From: Ivan Krylov > Sent: Tuesday, October 4, 2022 5:43 PM > To: PIKAL Petr > Cc: r-help mailing list > Subj

[R] R version 4.2.1 install.packages does not work with IE proxy setting

2022-10-04 Thread PIKAL Petr
to somehow corrupted installation? Should we set something differently for this new R version Best regards Petr __ 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://

Re: [R] Combine two dataframe with different row number and interpolation between values

2022-08-30 Thread PIKAL Petr
Hallo And missing value interpolation is rather tricky business dependent on what is underlying process. Maybe na.locf from zoo package? Or approxfun?, splinefun? Cheers Petr > -Original Message- > From: R-help On Behalf Of javad bayat > Sent: Wednesday, August 31, 2022 8:0

Re: [R] Combine two dataframe with different row number and interpolation between values

2022-08-30 Thread PIKAL Petr
Hallo Merge df3 <- merge(df1, df2, all=T) > head(df3) y d h ws 1 2010 1 1 NA 2 2010 1 2 NA 3 2010 1 3 20.4631367884005 4 2010 1 3 NA 5 2010 1 4 NA 6 2010 1 5 NA Cheers Petr > -Origina

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-27 Thread PIKAL Petr
type. To get more specific answer you need to ask specific question preferably with some data included (most preferably by dput command) and error message. Cheers Petr From: Ranjeet Kumar Jha Sent: Wednesday, July 27, 2022 8:35 AM To: PIKAL Petr Cc: R-help Subject: Re: [R] Ne

Re: [R] Need to insert various rows of data from a data frame after particular rows from another dataframe

2022-07-26 Thread PIKAL Petr
Hi. >From what you say, plain "rbind" could be used, if the columns in both sets are the same and in the same order. After that you can reorder the resulting data frame as you wish by "order". AFAIK for most functions row order in data frame does not matter. Cheers Petr

Re: [R] split apply on multiple variables

2022-07-01 Thread PIKAL Petr
Hi Maybe lapply(mydf.split, function(x) aggregate(x[,4:5], list(x$date), sum)) For your particular case, but lacking overall genarality. Cheers Petr > -Original Message- > From: R-help On Behalf Of Naresh Gurbuxani > Sent: Friday, July 1, 2022 1:08 PM > To: r-help@r

Re: [R] Dplyr question

2022-06-23 Thread PIKAL Petr
5 10 Jun-10 11:25 P190-90D -0.000195 You need only rename columns if necessary. Cheers Petr > -Original Message- > From: R-help On Behalf Of Richard O'Keefe > Sent: Thursday, June 23, 2022 2:29 AM > To: Thomas Subia > Cc: r-help@r-project.org > Subject: Re: [R]

Re: [R] missing values error in if statement

2022-05-20 Thread PIKAL Petr
factor function. You probably modified the code from help page but in that case you should check if all your objects are the same mode and structure as the objects in help page code. Cheers Petr From: Neha gupta Sent: Friday, May 20, 2022 3:22 PM To: PIKAL Petr Cc: r-help mailing list Subject: R

Re: [R] missing values error in if statement

2022-05-20 Thread PIKAL Petr
0 0 0 0 0 0 0 0 0 0 0 0 0 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [112] 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 the code runs smoothly without error. Cheers Petr > -Original Message- > From: R-help On Behalf O

Re: [R] ggplot pointrange from other df and missing legend

2022-05-16 Thread PIKAL Petr
s = 19, labels = NULL) You are correct that legend for bars is there. But the legend for points is missing. If I use only geom_point and values from the "test" data, also legend for the point appears. Is it possible that the second legend could be created only if all data are from one

[R] ggplot pointrange from other df and missing legend

2022-05-16 Thread PIKAL Petr
bels=c("bla", "blabla"))+ guides(fill= guide_legend(override.aes = list(shape=NA)))+ scale_shape_manual(name = "Measured", values=19, labels=NULL) But instead of points I want to use pointrange with data from other df. I found some help and all is good excep

Re: [R] customizing edit.data.frame

2022-05-02 Thread PIKAL Petr
Hallo I do not have much experience with Linux, Rstudio and ESS, but you can customise R startup by .Rprofile.site .Rconsole files which are situated in /etc directory of your installation You can find some info about it in Rintro chapter 10.8 Customizing the environment Cheers Petr

Re: [R] Violin plots in R

2022-04-01 Thread PIKAL Petr
Hi. Beside advice of others, at least str(yourdata) and the ggplot code is minimum for us to be able to offer some advice. Preferable way how to send your data is output from dput(yourdata) or dput(head(yourdata)) Just copy paste to your email. Cheers Petr > -Original Mess

Re: [R] pcalg library : estimated DAG graph

2022-03-31 Thread PIKAL Petr
package installed as required by plotting functions of the package. R> stopifnot(require(Rgraphviz))# needed for all our graph plots Cheers Petr > -Original Message- > From: R-help On Behalf Of varin sacha via > R-help > Sent: Friday, April 1, 2022 12:09 AM > To: r-

Re: [R] NA's in segmented

2022-03-10 Thread PIKAL Petr
"dog") applies here) 4. why do you use as.numeric(data[,"meanMSD25"]), shouldn't the column be numeric itself? So my wild guess is that you read the data into R wrong way and instead of numeric they are character, which could be one source of your problem. Cheers Pe

Re: [R] Question About lm()

2022-02-09 Thread PIKAL Petr
Hi Is it enough for explanation? https://stats.stackexchange.com/questions/26176/removal-of-statistically-sig nificant-intercept-term-increases-r2-in-linear-mo https://stackoverflow.com/questions/57415793/r-squared-in-lm-for-zero-interc ept-model Cheers Petr > -Original Message- >

Re: [R] Error in if (fraction <= 1) { : missing value where TRUE/FALSE needed

2022-01-26 Thread PIKAL Petr
t;- ifelse(test$operator == 'T13', 1, 0) the most probable source of the error is fc= fairness_check(explainer, protected = prot, privileged = privileged) so you should check explainer and privileged Cheers Petr From: javed khan Sent: We

Re: [R] Error in if (fraction <= 1) { : missing value where TRUE/FALSE needed

2022-01-26 Thread PIKAL Petr
do not know that they are used in you commands. Try to start fresh R session and try to inspect your environment with ls() Cheers Petr > -Original Message- > From: R-help On Behalf Of javed khan > Sent: Wednesday, January 26, 2022 3:05 PM > To: Ivan Krylov > Cc: R-help

Re: [R] Error in if (fraction <= 1) { : missing value where TRUE/FALSE needed

2022-01-26 Thread PIKAL Petr
quot;T9" "T12" "T9" > str(fake) chr [1:100] "T7" "T9" "T3" "T9" "T12" "T9" "T19" "T19" "T12" "T2" "T17" ... > Cheers Petr > -Original Mess

Re: [R] function problem: multi selection in one argument

2022-01-25 Thread PIKAL Petr
Hallo You should explain better what do you want as many people here do not use tidyverse functions. I am not sure what the function should do. table(iris$Species) give the same result and whatever you do in tidyverse part it always finalise in table(...$Species) Cheers Petr > -Origi

Re: [R] (Off-Topic) Time for a companion mailing list for R packages?

2022-01-13 Thread PIKAL Petr
umbers increasing? Cheers Petr > -Original Message- > From: R-help On Behalf Of Kevin Thorpe > Sent: Thursday, January 13, 2022 1:45 PM > To: Jeff Newmiller > Cc: R Help Mailing List > Subject: Re: [R] (Off-Topic) Time for a companion mailing list for R packages? >

Re: [R] ggtree node labels

2022-01-09 Thread PIKAL Petr
Hi If you asked google ggtree node label you will get many hits which tell you how to label nodes E.g. https://bioc.ism.ac.jp/packages/3.3/bioc/vignettes/ggtree/inst/doc/treeAnnot ation.html And you will get it much more quickly than by asking here. Cheers Petr > -Original Mess

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread PIKAL Petr
orld', xlim = c(91, 142), ylim = c(25, 40), lwd=1.5, col = "grey",border=NA, fill = T, bg="white") par("mar") box() should give you info how mar looks like before each step and which one is to blame. Jim gave you also some possible workaround. Cheers Petr > --

Re: [R] unexpected (?) behavior of box()

2022-01-06 Thread PIKAL Petr
changed during plotting map and after you define it again box use new mar values. Cheers Petr > -Original Message- > From: R-help On Behalf Of ani jaya > Sent: Friday, January 7, 2022 8:25 AM > To: r-help > Subject: [R] unexpected (?) behavior of box() > > Dear R e

Re: [R] splitting data matrix into submatrices

2022-01-05 Thread PIKAL Petr
at[which(fac==2), ] [,1] [,2] [,3] [,4] [1,]27 12 17 [2,]49 14 19 Cheers Petr > -Original Message- > From: R-help On Behalf Of Jeff Newmiller > Sent: Wednesday, January 5, 2022 8:57 AM > To: Faheem Jan ; R-help > Subject: Re: [R] splittin

Re: [R] how to run r biotools boxM terst on multiple groups?

2022-01-04 Thread PIKAL Petr
Hi. Not sure if statistically correct but what about iris$int<- interaction(iris$bin, iris$Species) boxM(iris[,1:4], iris[,7]) Cheers Petr > -Original Message- > From: R-help On Behalf Of Luigi Marongiu > Sent: Tuesday, January 4, 2022 11:56 AM > To: r-help > Subje

Re: [R] Multiple Data Import Excel

2022-01-04 Thread PIKAL Petr
Hi Try readxl package which has possibility to limit range of cells for reading. https://cran.r-project.org/web/packages/readxl/readxl.pdf Cheers Petr > -Original Message- > From: R-help On Behalf Of Bradley Heins via > R-help > Sent: Tuesday, January 4, 2022 4:20 AM &g

Re: [R] mixture univariate distributions fit

2022-01-03 Thread PIKAL Petr
need to do my homework if I decided to code such function myself. Thank you again and best regards. Petr > -Original Message- > From: Bert Gunter > Sent: Friday, December 31, 2021 6:57 PM > To: PIKAL Petr > Cc: Ivan Krylov ; r-help mailing list project.org> >

Re: [R] mixture univariate distributions fit

2021-12-31 Thread PIKAL Petr
ly way how to procced is to code such function by myself and take care of suitable starting values. Best regards. Petr > -Original Message- > From: Ivan Krylov > Sent: Friday, December 31, 2021 9:26 AM > To: PIKAL Petr > Cc: r-help mailing list > Subject: Re: [R] mixture

Re: [R] mixture univariate distributions fit

2021-12-30 Thread PIKAL Petr
in-r but I do not like to reinvent the wheel. I went through Chemometrics and Computational Physics task view, which I consider most appropriate to have such functions but it is usually quite specific, especially in required input data form. Anyway, thanks for your effort. I wish you best for n

Re: [R] mixture univariate distributions fit

2021-12-30 Thread PIKAL Petr
ind(test$mu, test$sigma, test$mix_ratio)) [,1] [,2] [,3] [1,] 170.7744 7.200109 0.5759867 [2,] 229.1815 10.831626 0.4240133 But it is probably in stage of intensive development as it is limited in data visualisation Any further hint is appreciated. Regards Petr > -Or

[R] mixture univariate distributions fit

2021-12-29 Thread PIKAL Petr
lambda 0.576346 0.423654 mu 170.784520 229.192823 sigma7.203491 10.793461 loglik at estimate: -424062.7 > Is there any way how to get such values directly from density or cummulative density estimation without generating fake data by sample? Best regards Petr temp1 <- structure(li

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread PIKAL Petr
no obvious candidate for the minimum.) Cheers Petr > -Original Message- > From: R-help On Behalf Of Stephen H. > Dawson, DSL via R-help > Sent: Wednesday, December 1, 2021 5:11 PM > To: r-help@r-project.org > Subject: Re: [R] Question about Rfast colMins and colMaxs &

Re: [R] converting to POSIXct

2021-11-30 Thread PIKAL Petr
Hi, that is what I tried to show to Stefano. That the issue was only with printing the values on console or as you explained in more depth the default formating when all time values (HMS) are zero. So that Stefano used correct syntax. Cheers Petr > -Original Message- > From:

Re: [R] converting to POSIXct

2021-11-30 Thread PIKAL Petr
m-%d %H:%M:%S", tz="Etc/GMT-1") [1] "2002-11-01 00:01:00 +01" "2002-11-01 00:00:00 +01" So nothing wrong in uyour code, hours are there but they are probably not printed to console and hours are there but hidden. Cheers Petr > -Original Message-

Re: [R] vectorization of loops in R

2021-11-18 Thread PIKAL Petr
Hi above tapply and aggregate, split *apply could be used) sapply(with(df, split(z, y)), mean) Cheers Petr > -Original Message- > From: R-help On Behalf Of Luigi Marongiu > Sent: Wednesday, November 17, 2021 2:21 PM > To: r-help > Subject: [R] vectorization of loops

Re: [R] Date

2021-11-04 Thread PIKAL Petr
Hi Not sure why the date format was changed but if I am correct R do not read dates as dates but as character vector. You need to transfer such columns to dates by asDate. The error is probably from your use two asDate commands. Cheers Petr -Original Message- From: R-help On Behalf Of

Re: [R] by group

2021-11-02 Thread PIKAL Petr
ult > library(reshape2) Warning message: package 'reshape2' was built under R version 4.0.4 > dcast(res, Year~Sex) Using x as value column: use value.var to override. YearFM 1 2001 12.0 15.0 2 2002 13.3 16.3 3 2003 12.0 15.0 Cheers Petr >

Re: [R] customize the step value

2021-10-29 Thread PIKAL Petr
TRUE FALSE TRUE TRUE > Cheers Petr > -Original Message- > From: R-help On Behalf Of Erich Subscriptions > Sent: Friday, October 29, 2021 9:17 AM > To: Catherine Walt > Cc: R mailing list > Subject: Re: [R] customize the step value > > seq(1.5,3.5,0.5) &g

Re: [R] Replacing NA s with the average

2021-10-18 Thread PIKAL Petr
Hi. sometimes is worth to try google first R fill NA with average resulted in https://stackoverflow.com/questions/25835643/replace-missing-values-with-col umn-mean and from that library(zoo) na.aggregate(DF) will replace all numeric NA values with column averages. Cheers Petr

Re: [R] creating a new variable and merging it on the dataframe

2021-10-18 Thread PIKAL Petr
Hi I cannot say anything about mutate but read.csv results in data frame you can use then wbpractice$gap <- with(wbpractice, total.food.exp-total.nfood.exp) Cheers Petr BTW, do not use HTML formating your email is a mess. > -Original Message- > From: R-help On Behalf

[R] Does intersect preserve order?

2021-10-17 Thread petr smirnov
Hi, Is base::intersect guaranteed to return items in the order they (first) appear in the first argument? I couldn't find any mention of this in the help file for set operations. If so, could this be documented on the help page? Thanks, Petr [[alternative HTML version de

[R] complicated sequence with preset length

2021-10-12 Thread PIKAL Petr
1, vec2)) part <- (len/base.len-trunc(len/base.len)) result <- if (part==0) rep(c(vec1,vec2), len/base.len) else c(rep(c(vec1,vec2), len/base.len), base.vec[1:(base.len*part)]) Is there any way how to achieve the result by simpler way? Best regards Petr __

Re: [R] unexpected behavior in apply

2021-10-11 Thread PIKAL Petr
preferable as it is designed for lists and data frame is (again from documentation) A data frame is a list of variables of the same number of rows with unique row names, given class "data.frame". > sapply(d,function(x) all(x[!is.na(x)]<=3)) d1d2d3 FALSE TRUE FAL

Re: [R] adding results to plot

2021-10-07 Thread PIKAL Petr
. Thanks and best regards. Petr > -Original Message- > From: Rui Barradas > Sent: Friday, September 17, 2021 9:56 PM > To: PIKAL Petr ; r-help > Subject: Re: [R] adding results to plot > > Hello, > > *.test functions in base R return a list of class "htest"

Re: [R] Strange behavior of 2-d array within function

2021-10-07 Thread PIKAL Petr
problem. Cheers Petr > -Original Message- > From: R-help On Behalf Of Gabriel Toro > Sent: Wednesday, October 6, 2021 8:32 PM > To: r-help@r-project.org > Subject: [R] Strange behavior of 2-d array within function > > Hi, > > I have a function, which defines an

Re: [R] Need in formatting data for circos plot

2021-10-05 Thread PIKAL Petr
Hm, Maybe if you change > C(-7, 7) Error in C(-7, 7) : object not interpretable as a factor to > c(-7, 7) [1] -7 7 Cheers Petr S pozdravem | Best Regards RNDr. Petr PIKAL Vedoucí Výzkumu a vývoje | Research Manager PRECHEZA a.s. nábř. Dr. Edvarda Beneše 1170/24 | 750 02 Přerov |

Re: [R] adding results to plot

2021-09-16 Thread PIKAL Petr
Thanks Jim This seems to be strightforward and quite simple. I considered addtable2plot but was not sure how to make propper data frame from the result. Regards Petr > -Original Message- > From: Jim Lemon > Sent: Friday, September 17, 2021 2:31 AM > To: PIKAL Petr ; r-

Re: [R] adding results to plot

2021-09-16 Thread PIKAL Petr
Thanks, I will try to elaborate on it. Best regards. Petr > -Original Message- > From: R-help On Behalf Of Kimmo Elo > Sent: Thursday, September 16, 2021 4:45 PM > To: r-help@r-project.org > Subject: Re: [R] adding results to plot > > Hi! > > Maybe with t

Re: [R] adding results to plot

2021-09-16 Thread PIKAL Petr
Hallo Thanks, I will try wat option is better if yours or Kimmo's Best regards Petr > -Original Message- > From: Bert Gunter > Sent: Thursday, September 16, 2021 5:00 PM > To: PIKAL Petr > Cc: r-help > Subject: Re: [R] adding results to plot > > I was

Re: [R] unable to remove NAs from a data frame

2021-09-16 Thread PIKAL Petr
Hi You should consult either complete.cases function or to remove only rows in which are only NAs you could use something like (untested) df[!(colSums(is.na(df))==8),] Cheers Petr > -Original Message- > From: R-help On Behalf Of Ana Marija > Sent: Thursday, September 16, 202

[R] adding results to plot

2021-09-16 Thread PIKAL Petr
an do it one by one > text(locator(1), res$method) > text(locator(1), as.character(res$p.value)) ... But it is quite inconvenient I could find some way in ggplot world but not in plain plot world. Best regards Petr __ R-help@r-project.org

Re: [R] How to globally convert NaN to NA in dataframe?

2021-09-02 Thread PIKAL Petr
3 10 NA NA -0.5263897 So my "nice compact command" dat[sapply(dat, is.nan)] <- NA works as expected, but summary gives as mean NAN. Cheers Petr > -Original Message- > From: R-help On Behalf Of Luigi Marongiu > Sent: Thursday, September 2, 2021 3:46 PM > To: Andre

Re: [R] Loop over columns of dataframe and change values condtionally

2021-09-02 Thread PIKAL Petr
3.2 11.310.2 setosa 4 4.6 3.1 11.510.2 setosa 5 5.0 3.6 11.410.2 setosa 6 5.4 3.9 11.710.4 setosa Cheers Petr > -Original Message- > From: R-help On Behalf

Re: [R] How to globally convert NaN to NA in dataframe?

2021-09-02 Thread PIKAL Petr
Hi what about data[sapply(data, is.nan)] <- NA Cheers Petr > -Original Message- > From: R-help On Behalf Of Luigi Marongiu > Sent: Thursday, September 2, 2021 3:18 PM > To: r-help > Subject: [R] How to globally convert NaN to NA in dataframe? > > Hello, >

Re: [R] Converting characters back to Date and Time

2021-09-01 Thread PIKAL Petr
Hi You can use as.POSIXct function https://stackoverflow.com/questions/19172632/converting-excel-datetime-seria l-number-to-r-datetime But you should preferably try to read the date as character vector and then convert it to date and time. Cheers Petr > -Original Message- > F

Re: [R] Selecting elements

2021-08-24 Thread PIKAL Petr
ult[[i]] <- sss[[i]][1:selection[i],] } Maybe someone come with other ingenious solution. Cheers Petr From: Silvano Cesar da Costa Sent: Monday, August 23, 2021 7:54 PM To: PIKAL Petr Cc: r-help@r-project.org Subject: Re: [R] Selecting elements Hi, I apologize for the confusion. I will t

Re: [R] Selecting elements

2021-08-23 Thread PIKAL Petr
alue is in D so either 3A - 3B - 2C - 2D or 3A - 3B - 2C - 2D should be appropriate. And here I am again lost as both sets are same. Maybe you need to reconsider your statements. Cheers Petr From: Silvano Cesar da Costa Sent: Friday, August 20, 2021 9:28 PM To: PIKAL Petr Cc: r-help@r-project.

Re: [R] Selecting elements

2021-08-19 Thread PIKAL Petr
first and fourth biggest value, you follow third option and select 3 highest A, 3B 2C and 2D? Or I do not understand at all what you really want to achieve. Cheers Petr > -Original Message- > From: R-help On Behalf Of Silvano Cesar da > Costa > Sent: Thursday, August 19,

Re: [R] Getting different results with set.seed()

2021-08-19 Thread PIKAL Petr
Hi Did you try different order? Step 2: set.seed (123) Step 1. Self-coded functions (these functions generate random numbers as well) Step 3: Call those functions. Step 4: model results. Cheers Petr. And BTW, do not use HTML formating, it could cause problems in text only list. From: Shah

  1   2   3   4   5   6   7   8   9   10   >