首页 \ 问答 \ data.frame对象到R中的xts对象转换(data.frame object to xts object conversion in R)

data.frame对象到R中的xts对象转换(data.frame object to xts object conversion in R)

我想尽可能高效地将我的csv文件转换为xts对象。 我似乎陷入困境,因为必须首先应用read.zoo方法创建动物园对象才能将其转换为xts对象。

gold <- read.zoo("GOLD.CSV", sep=",", format="%m/%d/%Y", header=TRUE)

Gold <- as.xts (gold, order.by=index(gold), frequency=NULL)

这是将我的初始GOLD.CSV文件转换为R xts对象的最有效方法吗?


I'd like to convert my csv files into xts objects as efficiently as possible. I seem to be stuck though with having to first applying the read.zoo method to create a zoo objects before being able to convert it to an xts object.

gold <- read.zoo("GOLD.CSV", sep=",", format="%m/%d/%Y", header=TRUE)

Gold <- as.xts (gold, order.by=index(gold), frequency=NULL)

Is this the most efficient way of converting my initial GOLD.CSV file into an R xts object?


原文:https://stackoverflow.com/questions/3508333
更新时间:2022-12-02 15:12

最满意答案

您可以在代码后面声明一个受保护的变量。 从数据库设置其值。

protected variable_name as string = "12, 45, 54"

在您的aspx文件中,您使用该变量,如,

data: [<%= variable_name%>]

You can declare one protected variable in code behind. Set its value from database.

protected variable_name as string = "12, 45, 54"

In your aspx file, you use that variable like,

data: [<%= variable_name%>]

相关问答

更多
  • 每次调用functions()时,您都在创建一个新的functions实例。 在这种情况下,最好使用带static函数和静态变量的struct 。 struct functions { static var DataSent = "Sensor" static func setValue (DataSent: String) { self.DataSent = DataSent } static func getValue () -> String { ...
  • 你可以通过多种方式做到这一点,这是最常见的两种方式。 方法1 为要打印的每个页面创建用户控件在用户打印页面的页面中添加这些用户控件。将每个用户控件放在单独的div中并放在主容器中,并在打印时获取容器div的css,其中包括所有数据。 方法2 在主容器的新窗口中为每个页面创建div。在页面加载时以div为单位加载数据,当用户按下Print时,获取容器div的所有html并打印出来。 You can do this in many ways here are two most common. Method 1 ...
  • 为了获得智能感知,您可以将代码封装在块中并在保存之前将其删除。 这可能是由开发人员创建的,他们不想,也不可能或没有时间编写面向对象的JavaScript。 通过配置对象封装逻辑和配置将允许您将代码从外部变量依赖关系中解耦(例如, var foo = <%= SomeServerSideVariable %> )。 To get intellisense you could wrap the code in