Re: [R] read txt file - date - no space

2018-07-31 Thread Diego Avesani
Dear all, I am sorry, I did a lot of confusion. I am sorry, I have to relax and stat all again in order to understand. If I could I would like to start again, without mixing strategy and waiting for your advice. I am really appreciate you help, really really. Here my new file, a *.csv file (buy th

[R] Problem with Rtools version 3.5.0.4

2018-07-31 Thread Steven Yen
I am trying to build an R package with Rtools version 3.5.0.4 along with R-3.5.1 using the following  sequence of commands: File -> Open Project -> Build -> Build Binary Package I received the following error message: zip I/O error: No such file or directory zip error: Temporary file failure (Y

Re: [R] read txt file - date - no space

2018-07-31 Thread Jeff Newmiller
... and the most common source of NA values in time data is wrong timezones. You really need to make sure the timezone that is assumed when the character data are converted to POSIXt agrees with the data. In most cases the easiest way to insure this is to use Sys.setenv(TZ="US/Pacific") or wha

Re: [R] read txt file - date - no space

2018-07-31 Thread Jim Lemon
Hi Diego, I think the error is due to NA values in your data file. If I extend your example and run it, I get no errors: MyData<-read.table(text="103001930 103001580 103001530 1998-10-01 00:00:00 0.6 0 0 1998-10-01 01:00:00 0.2 0.2 0.2 1998-10-01 02:00:00 0.6 0.2 0.4 1998-10-01 03:00:00 0 0 0.6 19

Re: [R] RStudio 1.1.453 - Windows 10 - How to subset named vector by names that are NOT "foo"

2018-07-31 Thread Data Science Classes
You can do Vect[-grep (“foo”, names(vect))] On Tue, 31 Jul 2018 at 11:12 PM, إبراهيم خطاب Ibrauheem Khat'taub < barhomopo...@gmail.com> wrote: > H > i All, > > If I have this vector: > > > vect <- c(foo = 11, bar = 2, norf = 45) > > I can have a subset that has only "bar and "norf" this way: > >

Re: [R] RStudio 1.1.453 - Windows 10 - How to subset named vector by names that are NOT "foo"

2018-07-31 Thread إبراهيم خطاب Ibrauheem Khat'taub
Awesome, thanks! مع خالص الشكر والسلام عليكم. إبراهيم خطاب On Tue, 31 Jul 2018 at 13:54, Data Science Classes < datascienceclas...@gmail.com> wrote: > You can do > > Vect[-grep (“foo”, names(vect))] > > On Tue, 31 Jul 2018 at 11:12 PM, إبراهيم خطاب Ibrauheem Khat'taub < > barhomopo...@gmail.com>

Re: [R] RStudio 1.1.453 - Windows 10 - How to subset named vector by names that are NOT "foo"

2018-07-31 Thread إبراهيم خطاب Ibrauheem Khat'taub
Awesome, Sarah, thanks! And thanks for the clarification about declaring the version of R. Best, Ibrahim On Tue, 31 Jul 2018 at 13:50, Sarah Goslee wrote: > Hi, > > You need to tell R to look in the names component of your vector. Here > are three different ways: > > vect <- c(foo = 11, bar =

Re: [R] RStudio 1.1.453 - Windows 10 - How to subset named vector by names that are NOT "foo"

2018-07-31 Thread Sarah Goslee
Hi, You need to tell R to look in the names component of your vector. Here are three different ways: vect <- c(foo = 11, bar = 2, norf = 45) vect[!(names(vect) %in% c("foo"))] # easily generalizable to a longer list vect[!grepl("foo", names(vect))] vect[!(names(vect) == "foo")] There are many

Re: [R] RStudio 1.1.453 - Windows 10 - How to subset named vector by names that are NOT "foo"

2018-07-31 Thread Huzefa Khalil
try: vect[which(names(vect) != "foo")] On Tue, Jul 31, 2018 at 1:41 PM, إبراهيم خطاب Ibrauheem Khat'taub wrote: > H > i All, > > If I have this vector: > >> vect <- c(foo = 11, bar = 2, norf = 45) > > I can have a subset that has only "bar and "norf" this way: >> vect[c("bar","norf")] > > Now ho

[R] RStudio 1.1.453 - Windows 10 - How to subset named vector by names that are NOT "foo"

2018-07-31 Thread إبراهيم خطاب Ibrauheem Khat'taub
H i All, If I have this vector: > vect <- c(foo = 11, bar = 2, norf = 45) I can have a subset that has only "bar and "norf" this way: > vect[c("bar","norf")] Now how do I achieve the same by asking it for a subset that simply excludes "foo"? I tried all these, resulting in errors: vect[-"foo"]

Re: [R] read txt file - date - no space

2018-07-31 Thread Diego Avesani
Dear all, I have still problem with date. Could you please tel me how to use POSIXct. Indeed I have found this command: timeAverage, but I am not able to convert MyDate to properly date. Thank a lot I hope to no bother you, at least too much Diego On 31 July 2018 at 11:12, Diego Avesani wrot

Re: [R] read txt file - date - no space

2018-07-31 Thread Diego Avesani
Dear Jim, Dear all, thanks a lot. Unfortunately, I get the following error: st1_daily<-by(MyData$st1,MyData$date,mean)Error in tapply(seq_len(0L), list(`MyData$date` = c(913L, 914L, 925L, : arguments must have same length This is particularly strange. indeed, if I apply mean(MyData$str1

Re: [R] read txt file - date - no space

2018-07-31 Thread Diego Avesani
Dear all, I have found the error, my fault. Sorry. There was an extra come in the headers line. Thanks again. If I can I would like to ask you another questions about the imported data. I would like to compute the daily average of the different date. Basically I have hourly data, I would like to a

Re: [R] read txt file - date - no space

2018-07-31 Thread Diego Avesani
Dear all, I move to csv file because originally the date where in csv file. In addition, due to the fact that, as you told me, read.csv is a special case of read.table, I prefer start to learn from the simplest one. After that, I will try also the *.txt format. with read.csv, something strange hap

Re: [R] Unexpected YAML

2018-07-31 Thread Jeff Newmiller
... or deleting .RData and avoiding creating them in the future. Named save files (anything.RData) are useful but the autoload feature of .RData files is not and this particular behavior is one of the reasons why. On July 31, 2018 3:39:39 AM PDT, PIKAL Petr wrote: >Hi > >However if in .RData is

Re: [R] Unexpected YAML

2018-07-31 Thread PIKAL Petr
Hi However if in .RData is an object created by "yaml" and the package is not loaded it could cause this message. It was similar with ggplot objects if ggplot2 is not loaded. Removing this object and saving session to update .RData can help. Cheers Petr > -Original Message- > From: R-

Re: [R] Unexpected YAML

2018-07-31 Thread Rainer Krug via R-help
.RData does not save any info abut previously loaded packages - so this would not cause the problem. Rainer > On 30 Jul 2018, at 21:27, Rui Barradas wrote: > > Hello, > > Maybe R is loading a previously saved session. > Check whether you have a file named .RData in your working directory. >

Re: [R] read txt file - date - no space

2018-07-31 Thread Jim Lemon
Hi Diego, One way you can get daily means is: st1_daily<-by(MyData$st1,MyData$date,mean) st2_daily<-by(MyData$st2,MyData$date,mean) st3_daily<-by(MyData$st3,MyData$date,mean) Jim On Tue, Jul 31, 2018 at 6:51 PM, Diego Avesani wrote: > Dear all, > I have found the error, my fault. Sorry. > There

Re: [R] dbGetQuery() returns wrong value

2018-07-31 Thread Enrico Schumann
Quoting Christofer Bogaso : The data type is defined as bigint Your query does not specify a number, but a string (you single-quote the digits). Databases may do type conversion; for instance, see the MySQL manual: https://dev.mysql.com/doc/refman/8.0/en/type-conversion.html Since you se