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] adding results to plot

2021-09-16 Thread PIKAL Petr
his: > > text(x=0.6, y=1.2, paste0(capture.output(res), collapse="\n"), adj=0) > > HTH, > > Kimmo > > to, 2021-09-16 kello 14:12 +, PIKAL Petr kirjoitti: > > Virhe vahvistaessa allekirjoitusta: Virhe tulkittaessa Dear all > > > > I

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] 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 | Czech Repub

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

2021-10-07 Thread PIKAL Petr
Hi I would print/save iteration number to see at what time this occured and probably traceback() could give you some hint. Alternatively you could make a function from your code see ?function and use debug to trace the error. Without some working example it is impossible to see where is the probl

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] unexpected behavior in apply

2021-10-11 Thread PIKAL Petr
Hi it is not surprising at all. from apply documentation Arguments X an array, including a matrix. data.frame is not matrix or array (even if it rather resembles one) So if you put a cake into oven you cannot expect getting fried potatoes from it. For data frames sapply or lapply is pr

[R] complicated sequence with preset length

2021-10-12 Thread PIKAL Petr
Dear all I know it is quite easy to get a simple seqence by rep function > c(rep(1:3, 2), rep(4:6,2)) [1] 1 2 3 1 2 3 4 5 6 4 5 6 I could easily get vector of length 24 or 36 using another rep > rep(c(rep(1:3, 2), rep(4:6,2)),2) [1] 1 2 3 1 2 3 4 5 6 4 5 6 1 2 3 1 2 3 4 5 6 4 5 6 > length(rep

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 Of Admire Tari

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 > -Origin

Re: [R] customize the step value

2021-10-29 Thread PIKAL Petr
Hi One has to be careful when using fractions in seq step. Although it works for 0.5 > (seq(0,10, .5) - round(seq(0,10,.5),2))==0 [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [16] TRUE TRUE TRUE TRUE TRUE TRUE in case of 0.3 (or others) it does not always resul

Re: [R] by group

2021-11-02 Thread PIKAL Petr
Hi Although you got several answers, simple aggregate was omitted. > with(dat, aggregate(wt, list(Year=Year, Sex=Sex), mean)) Year Sexx 1 2001 F 12.0 2 2002 F 13.3 3 2003 F 12.0 4 2001 M 15.0 5 2002 M 16.3 6 2003 M 15.0 you can reshape the result >

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] 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 in R > > Hello, >

Re: [R] converting to POSIXct

2021-11-30 Thread PIKAL Petr
Hi You probably has zero hours in all your data see > temp data_POSIX Sensor_code value 1 2002-11-01 00:00:001694 7.2 2 2002-11-01 00:00:001723 10.8 without hours > as.POSIXct(temp$data_POSIX, format = "%Y-%m-%d %H:%M:%S", tz="Etc/GMT-1") [1] "2002-11-01 +01" "2002-

Re: [R] converting to POSIXct

2021-11-30 Thread PIKAL Petr
Duncan Murdoch > Sent: Tuesday, November 30, 2021 12:05 PM > To: Jim Lemon ; PIKAL Petr > > Cc: r-help mailing list ; Stefano Sofia > > Subject: Re: [R] converting to POSIXct > > On 30/11/2021 3:41 a.m., Jim Lemon wrote: > > Hi, > > Petr is right. Apparently a

Re: [R] Question about Rfast colMins and colMaxs

2021-12-01 Thread PIKAL Petr
Hi. It is always worth to consult excellent R help. max and min return the maximum or minimum of all the values present in their arguments, as integer if all are logical or integer, as double if all are numeric, and character otherwise. Character versions are sorted lexicographically, and this

[R] mixture univariate distributions fit

2021-12-29 Thread PIKAL Petr
Dear all I have data which are either density distribution estimate or cummulative density distribution estimate (temp1, temp2 below). I would like to get values (mu, sd) for underlaying original data but they are not available. I found mixtools package which calculate what I need but it requires

Re: [R] mixture univariate distributions fit

2021-12-30 Thread PIKAL Petr
iginal Message- > From: Bert Gunter > Sent: Wednesday, December 29, 2021 5:01 PM > To: PIKAL Petr > Cc: r-help mailing list > Subject: Re: [R] mixture univariate distributions fit > > No. > > However, if the object returned is the "Value" structure of whate

Re: [R] mixture univariate distributions fit

2021-12-30 Thread PIKAL Petr
ew year 2022. Petr > -Original Message- > From: Bert Gunter > Sent: Thursday, December 30, 2021 5:10 PM > To: PIKAL Petr > Cc: r-help mailing list > Subject: Re: [R] mixture univariate distributions fit > > Petr: > > 1. I now am somewhat confused by your goa

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

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] 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 > To: r-help@r-pro

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 > Subject: [R] how to run r

Re: [R] splitting data matrix into submatrices

2022-01-05 Thread PIKAL Petr
Hi As Jeff said for data frames you can use split. If you insist to work with matrices, the principle is similar but you cannot use split. mat <- matrix(1:20, 5,4) mat [,1] [,2] [,3] [,4] [1,]16 11 16 [2,]27 12 17 [3,]38 13 18 [4,]49 14 19 [5,

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

2022-01-06 Thread PIKAL Petr
Hi. Why do you consider it unexpected? see map(database = "world", regions = ".", exact = FALSE, boundary = TRUE, interior = TRUE, projection = "", parameters = NULL, orientation = NULL, fill = FALSE, col = 1, plot = TRUE, add = FALSE, namesonly = FALSE, xlim = NULL, ylim = NULL, wrap = FA

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

2022-01-07 Thread PIKAL Petr
---Original Message- > From: ani jaya > Sent: Friday, January 7, 2022 9:12 AM > To: PIKAL Petr ; r-help > Subject: Re: [R] unexpected (?) behavior of box() > > Hi Petr, > > Thank you for pointing that out! Silly newbie here. > So, just want to make sure my

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 Message- > F

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

2022-01-13 Thread PIKAL Petr
Hallo all I do not consider answers here unresponsive or unfriendly. Most answers point to the way how to procced and solve the problems. Although RTFM is sometimes the best what anybody can do (and I did it myself around 1997 when I started with R). Hardly anybody here is flamed when he/she as

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 > -Original M

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

2022-01-26 Thread PIKAL Petr
Hi Do not post in HTML, please. Try to show your real data - use str(test), or preferably dput(test). If test is big, use only fraction of it The problem must be probably in your data. x <- sample(1:20, 100, replace=T) fake <- paste("T", x, sep="") ifelse(fake=="T14", 1,0) [1] 0 0 0 0 0 0 0 0

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

2022-01-26 Thread PIKAL Petr
Hi It seems that you are hiding what you really do. This > options(error = NULL) works fine without any error. So please If you want some reasonable answer post question with data and code which is causing the error. My wild guess is that you have some objects in your environment and you do not

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] 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- > From:

Re: [R] NA's in segmented

2022-03-10 Thread PIKAL Petr
Hi 1. Do not use HTML formated mail, your message is scrambled 2. With your code only you can get result all of us get error > Mod = lm(as.numeric(data[,"meanMSD25"])~(as.numeric(data[,"Slice"])), > weights=1*sqrt(as.numeric(data[,"Detec"]))) Error in data[, "meanMSD25"] : object of type 'clo

Re: [R] pcalg library : estimated DAG graph

2022-03-31 Thread PIKAL Petr
Hallo It is not obvious what is your problem. You maybe should go through some articles about functions in the package. https://pdfs.semanticscholar.org/aee5/cca63aad422c96ee637b5561bb051724d76c.pdf?_ga=2.241710466.1872226166.1648790330-1600227915.1617009045 or maybe you do not have Rgraphviz pa

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 Message- > Fro

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 > -Origi

[R] ggplot pointrange from other df and missing legend

2022-05-16 Thread PIKAL Petr
Hallo all Here are the data from dput test <- structure(list(Sample = c("A", "A", "A", "A", "A", "A", "B", "B", "B", "B", "B", "B", "C", "C", "C", "C", "C", "C"), SSAtype = c("one", "one", "one", "two", "two", "two", "one", "one", "one", "two", "two", "two", "one", "one", "one", "two", "

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

2022-05-16 Thread PIKAL Petr
data frame? Best regards Petr > -Original Message- > From: Rui Barradas > Sent: Monday, May 16, 2022 1:53 PM > To: PIKAL Petr ; r-help@r-project.org > Subject: Re: [R] ggplot pointrange from other df and missing legend > > Hello, > > In the code below the legen

Re: [R] missing values error in if statement

2022-05-20 Thread PIKAL Petr
Hi Strange, you say > prot <- ifelse(test$CE == '2', 1, 0) /// Error comes here but with your data ifelse(test$CE == '2', 1, 0) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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] Dplyr question

2022-06-23 Thread PIKAL Petr
Hallo all Various suggestion were made but with this simple task I immediatelly thought about reshape2 melt function. x <- "Time_stampP1A0B0D P190-90D 'Jun-10 10:34' -0.000208 -0.000195 'Jun-10 10:51' -0.000228 -0.000188 'Jun-10 11:02' -0.000234 -0.000204 'Jun-10 11:17' -0.00022

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-project.org > Subje

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 > -Original Message--

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] 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 > -Original Message- > Fro

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:09 AM > To:

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

2022-10-04 Thread PIKAL Petr
Dear all After we installed new R version R 4.2.1 installing packages through IE proxy setting is compromised with warning that R could not connect to server (tested in vanilla R). > chooseCRANmirror() Warning: failed to download mirrors file (cannot open URL 'https://cran.r-project.org/CRAN_mirr

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

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

2022-10-06 Thread PIKAL Petr
r 6, 2022 1:09 PM > To: r-help@r-project.org; PIKAL Petr > Subject: Re: [R]  R version 4.2.1 install.packages does not work with IE proxy > setting > > Petr, > You also might want to check out the bug reported here: > > https://bugs.r-project.org/show_bug.cgi?id=18379 &

Re: [R] Ids with matching number combinations?

2022-10-07 Thread PIKAL Petr
Hallo Marine Could you please make your example more reproducible by using set.seed (and maybe smaller)? If I understand correctly, you want to know if let say row 1 items from df2 (8,16) are both in item column of specific id? If I am correct in guessing, I cannot find another solution than spl

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

2022-11-04 Thread PIKAL Petr
Hi another option is to use SendTo folder. This was easy to find in older Windows versions. Now the easiest way is: Press the Windows Key + R to trigger the Run window. At the Open field in the window, type shell:SendTo and then click OK And SendTo folder should open. You can then add link to

[R] data frame returned from sapply but vector expected

2022-11-04 Thread PIKAL Petr
Hallo all I found a strange problem for coding if part of list is NULL. In this case, sapply result is ***list of data frames*** but if there is no NULL leaf, the result is ***list of vectors***. I tried simplify option but it did not help me neither I found anything in help page. The

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

2022-11-04 Thread PIKAL Petr
2022 1:37 PM > To: PIKAL Petr > Cc: R-help Mailing List > Subject: Re: [R] data frame returned from sapply but vector expected > > On Fri, 4 Nov 2022 15:30:27 +0300 > Ivan Krylov wrote: > > > sapply(mylist2, `[[`, 'b') > > Wait, that would simplify t

[R] if documentation

2022-12-06 Thread PIKAL Petr
Hallo all Not sure if it is appropriate place but as I am not involved in r-devel list I post here. Documentation for Control (if, for, while, .) is missing "if else" command. Although it can be find online elsewhere I believe that adding it either as an example or as a third entry and para

Re: [R] if documentation

2022-12-07 Thread PIKAL Petr
more than expected")} to the help page for if. Regards Petr > -Original Message- > From: Martin Maechler > Sent: Wednesday, December 7, 2022 12:16 PM > To: PIKAL Petr > Cc: R-help Mailing List > Subject: Re: [R] if documentation > > >>>>> PIKAL Petr

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 > Sent: Monday, January

Re: [R] Date order question

2023-01-04 Thread PIKAL Petr
Hallo Thomas Similar as suggested by Rui, you shall change your date to real date e.g. by library(lubridate) date <- paste(date, c(rep(2022,2), 2023), sep="-") date <- mdy(date) and you need to change also x coordinate in annotate. ggplot(data, aes(x=date,y=PT,group=1))+ geom_point(size=4)+

Re: [R] Reg: ggplot error

2023-01-11 Thread PIKAL Petr
Hi Attachments are mostly removed from emails so they probably will not reach r-help. You said you get an error, which is the first place you should look at. It can navigate you to the source of the error if you read it carefully. Anyway, if your code is complicated it is difficult to understand

Re: [R] Reg: ggplot error

2023-01-11 Thread PIKAL Petr
fill = "darkgrey") Cheers Petr And I do not provide private consulting so keep your posts to R help. Others may have much more insightful answers. From: Upananda Pani Sent: Wednesday, January 11, 2023 2:43 PM To: PIKAL Petr Subject: Re: [R] Reg: ggplot error Hi Res

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-project.org

Re: [R] package FactoMineR

2023-01-24 Thread PIKAL Petr
Hallo Sacha AFAIK the functions in FactoMineR do not enable to manipulate label size. Plot is performed by this part: if (graph & (ncp > 1)) { print(plot(res, axes = axes)) if (!is.null(quanti.sup)) print(plot(res, choix = "quanti.sup", axes = axes, ne

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

2023-01-26 Thread PIKAL Petr
Dear all I have this table > dput(mat) mat <- structure(c(2, 16, 9, 2, 16, 1, 1, 4, 7, 7, 44.52, 42.8, 43.54, 40.26, 40.09), dim = c(5L, 3L)) And I want to calculate result for contour or image plots as I did few years ago. However interp does not compute the z values and gives me zeros in z m

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

Re: [R] question

2023-01-30 Thread PIKAL Petr
Hallo Carolyn >From what you describe you cannot calculate correlations. You stated that you have two sets of data, one for December and one for March and that rows in one set is not related to the rows in another set and even persons tested in both months do not have their values on the same row

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, 2023 10:16 AM > To: r-hel

Re: [R] preserve class in apply function

2023-02-07 Thread PIKAL Petr
Hi Naresh If you wanted to automate the function a bit you can use sapply to find numeric columns ind <- sapply(mydf, is.numeric) and use it in apply construct apply(mydf[,ind], 1, function(row) sum(row)) [1] 2.13002569 0.63305300 1.48420429 0.13523859 1.17515873 -0.98531131 [7] 0.4704446

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, 2023 5:35 PM >

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 Brida Sent:

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

2023-03-21 Thread PIKAL Petr
Dear all. I am trying to install missing (not installed) packages during startup of R through code in Rprofile.site but I miserably failed and I am not sure what I am doing wrong. R is installed to C:Program files but it is not writable for the users, therefore I cannot change Rprofile.site

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

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-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] 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-project.org > Subject: [

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] combining data.frames with is.na & match (), two questions

2019-04-18 Thread PIKAL Petr
Hi I wonder why such combination is so complicated in your text book. Having data frames fr1 and fr2 > dput(fr1) structure(list(Fruit = structure(c(1L, 3L, 2L), .Label = c("banana", "mango", "pear"), class = "factor"), Calories = c(100L, 100L, 200L)), class = "data.frame", row.names = c("1", "2"

Re: [R] Help with a setting some values of a df vector to 0 but not all values

2019-04-18 Thread PIKAL Petr
Hi seems to me simple Sample data > nozero <- c(1565, 1569, 1674, 415, 1564) > test <- sample(c(1:10, nozero), 250, replace=T) > test [1] 10264 41559 1565 15692 10 1569 415 15693 [16]49 10115 1013 109 15644 108

Re: [R] combining data.frames with is.na & match (), two questions

2019-04-23 Thread PIKAL Petr
Hi Keep posts also to r-help, others could give you different/better solutions. Regarding ordering, see ?order or ?sort. However this is mainly necessary only for plotting or exporting data. Cheers Petr From: Drake Gossi Sent: Thursday, April 18, 2019 9:27 PM To: PIKAL Petr Subject: Re: [R

Re: [R] creating a data.frame from scratch

2019-04-23 Thread PIKAL Petr
Hi Structure is usefull for exchanging information and it is result of ?dput function. I wonder if anybody would like to use it for **creating** data frames. For creating data frames see functions like ?read.table, ?read.delim, or other ?read.* functions. Your questions are mainly adressed in

Re: [R] Is it possible to calculate in r the number of days and count of b in var r from the following table:

2019-04-23 Thread PIKAL Petr
Hi Your question is barely understandable. Maybe you wanted ?aggregate but without further precisement it is difficult to provide definitive answer. Cheers Petr > -Original Message- > From: R-help On Behalf Of ajaykumar cp > Sent: Wednesday, April 17, 2019 4:31 PM > To: r-help@r-proje

Re: [R] Pause script at input from terminal (interactive use)

2019-04-23 Thread PIKAL Petr
Hi Maybe you could think about transfering **script** to **function**. In function your construction seems to be OK. Cheers Petr > -Original Message- > From: R-help On Behalf Of Luigi Marongiu > Sent: Thursday, April 18, 2019 4:11 PM > To: r-help > Subject: [R] Pause script at input f

Re: [R] Error in using tokens script

2019-05-30 Thread PIKAL Petr
Hi. Most probably SMSSpamCollection$Message is not character, corpus or tokens object (which error message politely suggests). You need to change it to be correct mode functions ?str, ?mode, ?typeof to see your objects. And maybe also R intro chapter about objects and its differences. Cheers

Re: [R] How to generate mutiple set of samples in R?

2019-06-05 Thread PIKAL Petr
Hi Maybe ?sample within cycle? And collecting results in list. Cheers Petr > -Original Message- > From: R-help On Behalf Of Thevaraja, > Mayooran > Sent: Wednesday, June 5, 2019 4:38 AM > To: r-help@r-project.org > Subject: [R] How to generate mutiple set of samples in R? > > Hello > >

Re: [R] How to generate mutiple set of samples in R?

2019-06-05 Thread PIKAL Petr
Hi Mayooran It is better to keep your mails on rhelp. Others could answer too. see in line > -Original Message- > From: m.thevar...@massey.ac.nz > Sent: Wednesday, June 5, 2019 11:55 AM > To: PIKAL Petr > Subject: Re: How to generate mutiple set of samples in R?

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread PIKAL Petr
Hi It is probably time to consult documentation, including R-Intro. GGplot paradigm is that you have set of values (x,y) and factor variable(s) used for changing colour, size, plotting character or several other plot items. so something like pl <- ggplot(NewestdataULTRA, aes(x=x, y=value, colou

[R] debug only top level function

2019-06-06 Thread PIKAL Petr
Dear all I have a question about debug function. I did not use it for long time but my vague memory tell me, that when I used debug(myfunction) in past, only myfunction was debugged and browser ignored any embedded function. example (simple) fff <- function(x) mean(x, na.rm=T) when I issue >

Re: [R] debug only top level function

2019-06-06 Thread PIKAL Petr
d be worth considering to add something about it to debug help page. Best regards Petr > -Original Message- > From: Duncan Murdoch > Sent: Thursday, June 6, 2019 11:11 AM > To: PIKAL Petr ; r-help@r-project.org > Subject: Re: [R] debug only top level function > > On 0

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread PIKAL Petr
Hi Probably missing quotation marks in geom_smooth geom_smooth(method = "lm", se = FALSE) Cheers Petr > -Original Message- > From: R-help On Behalf Of rain1290--- via R- > help > Sent: Thursday, June 6, 2019 4:35 PM > To: ruipbarra...@sapo.pt; r-help@R-project.org > Subject: Re: [R] Pl

Re: [R] Changing the label name in the plot

2019-06-11 Thread PIKAL Petr
Attachments are not alowed (mostly) on this list. Use ?dput to show your data or at least part of your data illustrating the problém. Cheers Petr -Original Message- From: R-help On Behalf Of Subhamitra Patra Sent: Tuesday, June 11, 2019 8:05 AM To: ঋষি ( ऋषि / rIsHi ) Cc: r-help maili

Re: [R] Changing the label name in the plot

2019-06-11 Thread PIKAL Petr
Hi Ts should be numeric matrix if I read the help page correctly. However I get different error message > k2 <- kmeans(ts, centers = 2, nstart = 25) Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: In storage.mode(x) <- "double" : NAs introduced

Re: [R] Changing the label name in the plot

2019-06-11 Thread PIKAL Petr
From: Bert Gunter Sent: Tuesday, June 11, 2019 3:15 PM To: PIKAL Petr Cc: Subhamitra Patra ; Jim Lemon ; r-help mailing list Subject: Re: [R] Changing the label name in the plot There appear to be two columns with the same name. Surely this will cause problems. Bert Gunter "The trou

Re: [R] Editing an R source code

2019-06-14 Thread PIKAL Petr
Hi I do not use this package but this is written in manual: Custom splitting: All families except unsupervised are available for user defined custom splitting. Some basic C-programming skills are required. The harness for defining these rules is in splitCustom.c. In this file we give examples o

Re: [R] Help with Vline in ggplot/ggplotly

2019-06-17 Thread PIKAL Petr
Hi I may be completely missing your point but maybe simple geom_vline(xintercept = as.POSIXct("2019-06-11")) is what you want. Something like ggplot(aes(Date2,NetEditRev)) + geom_line(alpha=0.5, color = "#2c3e50") + geom_smooth(method = "loess", span= 0.5) + theme_tq() + scale_y_contin

Re: [R] Extract row as NA with no matching name

2019-08-08 Thread PIKAL Petr
Hi Do you insist to use matrix? If you change matrix to data frame it returns NA as required. mdat C.1 C.2 C.3 row1 1 2 3 row2 11 12 13 > mdat["some",] Error in mdat["some", ] : subscript out of bounds > mdatf<-as.data.frame(mdat) > mdatf["some",] C.1 C.2 C.3 NA NA NA NA Che

Re: [R] Need help with an iteration

2019-08-13 Thread PIKAL Petr
Hi I does not use Deducer so I do not know if it has some features for such task In plain R instead file.names <- dir(pattern = "*.txt") use file.names <- list.files(pattern = "*.txt") for(i in 1:length(file.names)){file <- > read.table(file.names[i],header=TRUE) # Here you want to change zero

Re: [R] Change of language interface in R

2019-08-27 Thread PIKAL Petr
Hi Google tells it to you in seconds https://stackoverflow.com/questions/13575180/how-to-change-language-settings-in-r BTW this was the first hit from phrase R how to change the language interface Cheers Petr > -Original Message- > From: R-help On Behalf Of CHATTON Anne > via R-help

Re: [R] Moving 2nd column into 1st column using R

2019-09-11 Thread PIKAL Petr
Or maybe use stack stack(mydf) Cheers Petr > -Original Message- > From: R-help On Behalf Of Jim Lemon > Sent: Tuesday, September 10, 2019 6:34 AM > To: smart hendsome ; r-help mailing list h...@r-project.org> > Subject: Re: [R] Moving 2nd column into 1st column using R > > Hi Zuhri, >

[R] test if something was plotted on pdf device

2019-09-12 Thread PIKAL Petr
Dear all Is there any simple way checking whether after calling pdf device something was plotted into it? In interactive session I used if (dev.cur()==1) plot(ecdf(rnorm(100))) else plot(ecdf(rnorm(100)), add=T, col=i) which enabled me to test if plot is open But when I want to call eg. pdf("

Re: [R] test if something was plotted on pdf device

2019-09-13 Thread PIKAL Petr
er it is finished to pdf. The only obstacle is that my code flashes during plotting to basic device, however I can live with it. Thank you again and best regards Petr > -Original Message- > From: Duncan Murdoch > Sent: Thursday, September 12, 2019 2:29 PM > To: PIKAL Petr

<    4   5   6   7   8   9   10   11   12   13   >