Friday 15 May 2015

r - Function to create xts object from keyboard input -


I have many sales areas, each one is a data.frame and I can create xts objects for each in it Each requires a line of code. I want to use the function to generate on demand. I have tried to use keyboard entry to create a character string, then sort quotation marks in a function and symbol For Store the input form. this does not work! user input [l]; - as.name (userinput [1]) #Unit task to specify user input; - Scan ("", what = "") user input & lt; # Xts Object Functions = XX = X (x) {xts (x [1], order = x $ starttime, date format = "pOSIXT")} ## create functionXX (user input) ## Results: & gt; ; & Gt; Error in X [1]: Type 'symbol' object is not subnetable

How to use data in a function to specify data. How can I use user input ? Note: If I change the x with the name of a real unit, then the createXts function works.

How about:

  CreateXts & lt; - Function () {xx & lt; - Scan ("", what = "") xx & lt; - get (xx [[1]] xts (xx, order.by = xx $ startup, datformat = "posicct")}    

No comments:

Post a Comment