rbind无法绑定datetime列

时间:2017-07-04 15:22:54

标签: r datetime

我绑定了许多数据帧数据帧,并注意到我在其中一个绑定中得到了奇怪的值。绑定后,第二个df中的日期时间受到干扰,比原始df小一个小时。

unit frmShapeStudy;

interface

type
  tMy_Shape = class (tShape)
  protected
    procedure Paint; override;
  public
    constructor Create (aOwner: tComponent); override;
    procedure   Draw;
  end;

  tformShapeStudy = class (tForm)
     trkBarLeft: TTrackBar;
     trkBarTop: TTrackBar;
    procedure FormCreate     (Sender: tObject);
    procedure TrackBarChange (Sender: tObject);
  end;

var
  formShapeStudy: tformShapeStudy;

implementation

{$R *.fmx}

var
  My_Shape    : tMy_Shape;
  lvShapeRect : tRectF   ;

procedure tformShapeStudy.FormCreate (Sender: tObject);
begin
  My_Shape := tMy_Shape.Create (Self);
  with My_Shape do begin
     Parent := Self;
     TrackBarChange (Self);
  end;
end;

procedure tformShapeStudy.TrackBarChange (Sender: TObject);
begin
  My_Shape.Draw;
end; 

constructor tMy_Shape.Create (aOwner: tComponent);
begin
  inherited;
  with lvShapeRect do begin
         Left   := Self.Left;
         Top    := Self.Top ;
         Height :=  20;
         Width  :=  20;
  end;
end;

procedure tBS_Shape.Draw;
begin
  l := formShapeStudy.trkBarLeft.Value;
  t := formShapeStudy.trkBarTop .Value;
  {`Left & Top` are set with `l & t` or with `120 & 150` 
  and tested separately, by commenting the propper code lines}
  lvShapeRect.Left   := l;    // this does no work
  lvShapeRect.Top    := t;    // this does no work
  lvShapeRect.Left   := 120;  // this works
  lvShapeRect.Top    := 150;  // this works
  Repaint;
end;

procedure tMy_Shape.Paint;
begin
  inherited;
  with Canvas do begin
       Fill  .Color := tAlphaColorRec.Aqua;
       Stroke.Color := tAlphaColorRec.Blue;
       BeginScene;
       FillRect (lvShapeRect, 0, 0, Allcorners, 1, tCornerType.Bevel);
       DrawRect (lvShapeRect, 0, 0, Allcorners, 1, tCornerType.Bevel);
       EndScene;
  end;
end;

end.

从不同的包调用函数给我相同的结果:

    kk <- structure(list(date = structure(c(1499133600, 1499137200, 1499140800, 
1499144400), class = c("POSIXct", "POSIXt"), tzone = "UTC"), 
    temp = c(14.7, 14.6, 14.3, 14.2)), .Names = c("date", "temp"
), row.names = c(NA, -4L), class = c("tbl_df", "tbl", "data.frame"
))   
ff <- structure(list(date = structure(c(1499144400, 1499148000, 1499151600, 
1499155200), class = c("POSIXct", "POSIXt"), tzone = ""), temp = 14:17), .Names = c("date", 
"temp"), row.names = c(NA, -4L), class = c("tbl_df", "tbl", "data.frame"
))

我不知道发生了什么。它可能与日期格式有关吗?

0 个答案:

没有答案