Hi
see in line
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Lee Marine
> Sent: Tuesday, January 21, 2014 7:17 AM
> To: r-help at r-project.org
> Subject: [R] My problem with R
>
> Hi, I am a student in trouble with R.
> please help me!
>
> I have a 16 huge data(.csv).
>
> data1<-read.csv(D://data1.csv, header=FALSE) .
> .
> .
> data16<-read.csv(D://data16.csv, header=FALSE)
>
> and then, I tried to seperated data w/ column.
>
> a1<-cbind(data1[1:36568,1])
> b1<-cbind(data1[1:36568,2])
> .
> .
> .
> ac16<-cbind(data16[1:85207,31])
>
> a column is a Date(yyyy-mm-dd)
> b column is a Time(hh:mm:ss)
> c to ac is a numeric data.
>
> finished this work, use "rbind" function.
>
> date<-rbind(a1,a2,a3,a4,.....,a16)
> time<-rbind(b1,b2,b3,..........,b16)
> .
> .
> .
> .
> ac<-rbind(ac1,ac2,ac3,...,ac16)
>
> I want to see yyyy-mm-dd format, but It does not work.
> >b
> [,1]
> [1,] 17753
> [2,] 17754
> [3,] 17755
> [4,] 17756
> [5,] 17757
> [6,] 17758
>
> >a
> [,1]
> [1,] 1
> [2,] 1
> [3,] 1
> [4,] 1
> [5,] 1
> [6,] 1
>
> I don't know why...
It is because you did not bother to make a glimpse to R-Intro to learn about
data types and how to work with them.
1. Reading such data to R means that they are transformed to character or
factor. See
?str
?factor
2. Functions rbind and cbind produce matrices if input is not a data frame.
Matrices can not hold different types of data as data frames.
> Question 1.
> I want to paste a and b >> yyyy-mm-dd hh:mm:ss
timestamp <-strptime(paste(data1[,1], data1[,2], sep=" "), format =
....)
see
?paste
?strptime
?as.POSIXct
how to do it exactly
>
> Question 2.
> I want to averaging mean, median for every each minute groups.
> for example)
see
?aggregate
for averaging and
?format
how to specify minute chunks.
Final remarks.
If you prototype the code for one file, you can do all computation in cycle.
Do not post in HTML
Post some data eg. by dput
Do your homework and read help pages. They are available, usually well written
and much effort is invested to them to be simply overlooked.
Regards
Petr
> Time c d e f
> . .
> .
> 2014-01-20 00:00:00 3.1428 1.99 0.123455 7.5526 2014-01-20 00:00:01
> 3.1887 1.03 0.176545 7.5234 2014-01-20 00:00:02 2.1876 1.27 0.987455
> 7.5996 ...
> 2014-01-20 00:01:00 5.4428 1.96 0.164455 7.8666 2014-01-20 00:01:01
> 1.5658 1.39 0.176545 7.7786 2014-01-20 00:01:02 3.1776 1.67 0.254655
> 7.4567
>
> then,
> Time average_C c d e
> f . . .
> 2014-01-20 00:00:00 here 3.1428 1.99 0.123455 7.5526
> 2014-01-20 00:00:01 3.1887 1.03 0.176545 7.5234
> 2014-01-20 00:00:02 2.1876 1.27 0.987455 7.5996
> ...
> 2014-01-20 00:01:00 here 5.4428 1.96 0.164455 7.8666
> 2014-01-20 00:01:01 1.5658 1.39 0.176545 7.7786
> 2014-01-20 00:01:02 3.1776 1.67 0.254655 7.4567
>
> PLEASE HELP ME, R-help!!!
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
________________________________
Tento e-mail a jak?koliv k n?mu p?ipojen? dokumenty jsou d?v?rn? a jsou ur?eny
pouze jeho adres?t?m.
Jestli?e jste obdr?el(a) tento e-mail omylem, informujte laskav? neprodlen? jeho
odes?latele. Obsah tohoto emailu i s p??lohami a jeho kopie vyma?te ze sv?ho
syst?mu.
Nejste-li zam??len?m adres?tem tohoto emailu, nejste opr?vn?ni tento email
jakkoliv u??vat, roz?i?ovat, kop?rovat ?i zve?ej?ovat.
Odes?latel e-mailu neodpov?d? za eventu?ln? ?kodu zp?sobenou modifikacemi ?i
zpo?d?n?m p?enosu e-mailu.
V p??pad?, ?e je tento e-mail sou??st? obchodn?ho jedn?n?:
- vyhrazuje si odes?latel pr?vo ukon?it kdykoliv jedn?n? o uzav?en? smlouvy, a
to z jak?hokoliv d?vodu i bez uveden? d?vodu.
- a obsahuje-li nab?dku, je adres?t opr?vn?n nab?dku bezodkladn? p?ijmout;
Odes?latel tohoto e-mailu (nab?dky) vylu?uje p?ijet? nab?dky ze strany p??jemce
s dodatkem ?i odchylkou.
- trv? odes?latel na tom, ?e p??slu?n? smlouva je uzav?ena teprve v?slovn?m
dosa?en?m shody na v?ech jej?ch n?le?itostech.
- odes?latel tohoto emailu informuje, ?e nen? opr?vn?n uzav?rat za spole?nost
??dn? smlouvy s v?jimkou p??pad?, kdy k tomu byl p?semn? zmocn?n nebo p?semn?
pov??en a takov? pov??en? nebo pln? moc byly adres?tovi tohoto emailu p??padn?
osob?, kterou adres?t zastupuje, p?edlo?eny nebo jejich existence je adres?tovi
?i osob? j?m zastoupen? zn?m?.
This e-mail and any documents attached to it may be confidential and are
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender.
Delete the contents of this e-mail with all attachments and its copies from your
system.
If you are not the intended recipient of this e-mail, you are not authorized to
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by
modifications of the e-mail or by delay with transfer of the email.
In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately
accept such offer; The sender of this e-mail (offer) excludes any acceptance of
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into
any contracts on behalf of the company except for cases in which he/she is
expressly authorized to do so in writing, and such authorization or power of
attorney is submitted to the recipient or the person represented by the
recipient, or the existence of such authorization is known to the recipient of
the person represented by the recipient.