[R] Incorrect Conversion of Datetime: Fixed

2020-01-08 Thread Ogbos Okike
Dear ALL, I am really happy. Erinco has pointed out the error. Out of the the 5 stations' Cosmic ray data I am staking together to show some similar effects, I wrongly (and I am sorry for taking your time) copied one of the dates, including January 1, 1998 instead of May. Others were correct and

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Jim Lemon
Enrico seems to have found the problem - you can't change dates much by changing the time zone, but transposing month and day will do the trick nicely. The mm/dd/ format and others like it are so common that you always have to be on the lookout for it. Is the sample data you included in your fi

Re: [R] editing plot

2020-01-08 Thread Rui Barradas
Hello, Maybe theme(panel.grid.major.x = element_line(size = 0.1, color = "grey"), panel.grid.major.y = element_blank(), panel.grid.minor = element_blank() ) Note that if you remove the y axis grid you must set the x axis grid explicitly. Hope this helps, Rui Barradas À

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Enrico Schumann
> On Wed, 8 Jan 2020 17:43:29 +0100, Ogbos Okike > writes: Ogbos> Dear Enrico, Ogbos> Thanks for your time. Ogbos> I have tried to learn how to use dput in R. I have not yet made much progress. Ogbos> I have succeeded in using dput to store my data frame. I first Ogbos> conve

Re: [R] editing plot

2020-01-08 Thread Ana Marija
I used width=0.5, to reduce bar widths and aspect.ratio = 2/1 to reduce white spaces between bars but now text on my x axis is overlapping and my plot is too elongated, and I don't have those 3 vertical lines trough bars. Please advise p<-ggplot(data=toplot, aes(x=cat, y=props)) + geom_bar(stat

[R] editing plot

2020-01-08 Thread Ana Marija
Hello, I have this plot in attach. I was wondering how can I change my plotting code in order to remove these gray horizontal background lines but keep these two vertical lines? These two vertical lines don't need to be gray, can be any other type of lines but they must be at the same place. Also

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Jeff Newmiller
a) R cannot deal with POSIXt vectors having more than one timezone in one vector. Won't happen. You need to separate the data into different data frames if you need to deal with importing data with different timezones. b) You say you included the lines Sys.timezone() str(OlsonNames()) in your

Re: [R] issue with Rcmdr

2020-01-08 Thread Bert Gunter
... and even more generally, is generally misleading. ;-) (search "problems with R^2" or similar for why). 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,

Re: [R] issue with Rcmdr

2020-01-08 Thread Norm Matloff
Glad to hear it now works for you. But speaking more generally, note that R-squared is the squared correlation between the predicted Y and actual Y values. E.g. lmout <- lm(y ~ x) print(cor(lmout$fitted.values,y)^2) One can use this in any regression setting, even machine learning methods. N

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Ogbos Okike
Dear Jeff, Thank you very much for looking into this. I have made some search on ?OlsonNames. System time zones indicates Africa/Lagos whereas the data I am trying to convert are Cosmic ray data prepared at different time zones including Oulu station (Russia), Climax station (America), many parts

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Ogbos Okike
Dear Enrico, Thanks for your time. I have tried to learn how to use dput in R. I have not yet made much progress. I have succeeded in using dput to store my data frame. I first converted my data into a data frame and then used: dput(dd,file="Ogbos2",control = c("keepNA", "keepInteger", "showAttrib

Re: [R] Dataframe by Serial ID

2020-01-08 Thread Eric Berger
Hi Thomas, Jeff is correct that this can be handled via merge, e.g. df3 <- merge( df2, df1, by="Serial", all=FALSE ) This operation is called an "inner join", and you could use other tools, such as the dplyr package to accomplish the same thing df3 <- dplyr::inner_join( df2, df1, by="Serial" ) H

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Jeff Newmiller
In your first email you said you were using Sys.setenv( TZ="GMT" ) in your code, which defines the default assumption for time conversion timezone (at least until you change it). Keep in mind that you may be dealing with data from other timezones than your local one that the operating system us

Re: [R] Dataframe by Serial ID

2020-01-08 Thread David Winsemius
> On Jan 8, 2020, at 6:52 AM, Thomas Subia wrote: > > Colleagues, > > I have two data frames which look like this. > > Data frame 1 > > Serial Pre.HolePre.flowPre.Date > 1 30361 0.2419-Nov-19 > 2 30362

Re: [R] Dataframe by Serial ID

2020-01-08 Thread Jeff Newmiller
"merge" is generally the base R answer to this question, and there are equivalent functions in various contributed packages. However, it is necessary to identify which columns in each table uniquely identify each row ("primary key"). If your Serial 3036 shows up 10 times in the first table and

[R] Dataframe by Serial ID

2020-01-08 Thread Thomas Subia
Colleagues, I have two data frames which look like this. Data frame 1 Serial Pre.HolePre.flowPre.Date 1 30361 0.2419-Nov-19 2 30362 0.212 19-Nov-19 3 30363

Re: [R] adjusted p value, fdr

2020-01-08 Thread Ana Marija
Thank you so much for this explanation! On Tue, Jan 7, 2020 at 4:37 PM Yuan Chun Ding wrote: > > When you do x1g$fdr, you adjusted for a total of 15568 tests, so FDR is > high for those first four entries. When you do p.adjust(pval,method="BH"), > you assumed there were only a total of 4 mult

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Ogbos Okike
Dear Jim, In order to check whether I have a correct time on my system, I run: $ timedatectl and it gives: Local time: Wed 2020-01-08 13:03:44 WAT Universal time: Wed 2020-01-08 12:03:44 UTC RTC time: Wed 2020-01-08 12:03:44 Time zo

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Enrico Schumann
Quoting Ogbos Okike : Dear Friends, A sample of my data is: 98 05 01 028541 98 05 01 038548 98 05 01 048512 98 05 01 058541 98 05 01 068509 98 05 01 078472 98 05 01 088454 98 05 01 098461 98 05 01 108462 98 05 01 118475 98 05 01 128433 98 05 01 13

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Ogbos Okike
Dear Jim, Thank you for coming my assist me. I have tried all you suggested but the same result keep coming. I tried, for example: dta <- read.table("Ohr1may98", col.names = c("year", "month", "day", "hour", "counts")) dta$year <- with( dta, ifelse(year < 50, year + 2000, year + 1900)) dta$date<-s

[R] Which external functions are called in a package? [Solved]

2020-01-08 Thread Hans W Borchers
By using the *pkgapi* package and with quite a bit of manual work I was able to (almost) automatically find all function calls to my package in 150 depending on, importing, or suggesting packages. It took two days to overcome all the obstacles during the process -- and was a very rewarding experien

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Jim Lemon
Hi again, Small typo, should be dta$date<-strptime(paste(dta$year,dta$month,dta$day,dta$hour), "%Y %m %d %H" as I tried it both with and without the century just to check and copied the wrong line. On Wed, Jan 8, 2020 at 9:03 PM Jim Lemon wrote: > > Hi Ogbos, > I get the correct result using s

Re: [R] spurious locking of packages

2020-01-08 Thread Ivan Krylov
On Fri, 27 Dec 2019 15:27:01 -0500 "Jan Galkowski" wrote: > *emoa* is a stand-in for whatever package faulted during the load. (I > also have no idea why *EMD* is locked in the above.) Both packages mentioned have NeedsCompilation: yes. Could it be the case that some anti-virus software is scann

Re: [R] Incorrect Conversion of Datetime

2020-01-08 Thread Jim Lemon
Hi Ogbos, I get the correct result using strptime: dta$date<-strptime(paste(dta$year,dta$month,dta$day,dta$hour), "%y %m %d %H" ) > dta$date [1] "1998-05-01 02:00:00 AEST" "1998-05-01 03:00:00 AEST" [3] "1998-05-01 04:00:00 AEST" "1998-05-01 05:00:00 AEST" [5] "1998-05-01 06:00:00 AEST" "1998-05-

[R] Incorrect Conversion of Datetime

2020-01-08 Thread Ogbos Okike
Dear Friends, A sample of my data is: 98 05 01 028541 98 05 01 038548 98 05 01 048512 98 05 01 058541 98 05 01 068509 98 05 01 078472 98 05 01 088454 98 05 01 098461 98 05 01 108462 98 05 01 118475 98 05 01 128433 98 05 01 138479 98 05 01 148417 9