You probably want:
q <- data.frame(100,200,200,200,200,200) colnames(q) <- colnames(SPY) q <- xts(q, as.Date("2016-01-26")) # SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted # 2016-01-26 100 200 200 200 200 200 class(SPY) # [1] "xts" "zoo" class(q) # [1] "xts" "zoo" tail(rbind(SPY, q)) # SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted # 2016-01-19 189.96 190.11 186.20 188.06 190196000 188.06 # 2016-01-20 185.03 187.50 181.02 185.65 280016900 185.65 # 2016-01-21 186.21 188.87 184.64 186.69 189174000 186.69 # 2016-01-22 189.78 190.76 188.88 190.52 163849600 190.52 # 2016-01-25 189.92 190.15 187.41 187.64 122676200 187.64 # 2016-01-26 100.00 200.00 200.00 200.00 200 200.00
Related Posts:
- How do I select the first row in an R data frame that meets certain criteria?
- Poker hand range chart visualization in R
- Critical t values in R
- Error in
: object of type ‘closure’ is not subsettable - What does %>% function mean in R?
- How to join (merge) data frames (inner, outer, left, right)
- rbind error: “names do not match previous names”
- rbind error: “names do not match previous names”
- R Error in x$ed : $ operator is invalid for atomic vectors
- Plotting with ggplot2: “Error: Discrete value supplied to continuous scale” on categorical y-axis
- ggplot2 error : Discrete value supplied to continuous scale
- What does na.rm=TRUE actually means?
- Remove legend ggplot 2.2
- Error in if/while (condition) {: missing Value where TRUE/FALSE needed
- How do I replace NA values with zeros in an R dataframe?
- How to change legend title in ggplot
- R on MacOS Error: vector memory exhausted (limit reached?)
- Why use as.factor() instead of just factor()
- mean() warning: argument is not numeric or logical: returning NA
- Non-numeric Argument to Binary Operator Error in R
- Why do I get “number of items to replace is not a multiple of replacement length”
- How can two strings be concatenated?
- Error in colMeans(x, na.rm = TRUE) : ‘x’ must be numeric in KNN classification
- Error in file(file, “rt”) : invalid ‘description’ argument in complete.cases program
- Remove a row from a data table in R
- Logistic Regression on factor: Error in eval(family$initialize) : y values must be 0 <= y <= 1
- rmarkdown error “attempt to use zero-length variable name”
- Extract year from date
- R – longer object length is not a multiple of shorter object length
- incorrect number of dimensions and incorrect number of subscripts in array
- Why am I getting “algorithm did not converge” and “fitted prob numerically 0 or 1” warnings with glm?
- Rotating and spacing axis labels in ggplot2
- How does one reorder columns in a data frame?
- Arcsine transformation of percentage data
- R loop that adds following numbers to each element in list
- R: Using equation with natural logarithm in nls
- Can I calculate z-score with R?
- What does c do in R?
- Using Caret Package but Getting Error in library(e1071)
- Reading PSV (pipe-separated) file or string
- Function to clear the console in R and RStudio
- Manually colouring plots with `scale_fill_manual` in ggplot2 not working
- Calculate correlation for more than two variables?
- Why I get this error writing data to a file
- Function to clear the console in R and RStudio
- How to count the number of observations in R like Stata command count
- Invalid factor level, NA generated warning
- Error: unexpected ‘}’ in “}” in R [duplicate]
- Error : length of ‘dimnames’ [2] not equal to array extent
- Mean of a column in a data frame, given the column’s name
- Can’t draw Histogram, ‘x’ must be numeric
- What is the difference between rm() and rm(list=ls())?
- Understanding `scale` in R
- Add empty columns to a dataframe with specified names from a vector
- Error with apply function
- Convert date-time string to class Date
- Generate a set of random unique integers from an interval
- Remove rows with all or some NAs (missing values) in data.frame
- Rotating and spacing axis labels in ggplot2
- How to sum data.frame column values?
- How do I get RSS from a linear model output
- Warning message: In `…` : invalid factor level, NA generated
- Error: invalid subscript type ‘list’ in R
- Is there a dictionary functionality in R
- Mean of a column in a data frame, given the column’s name
- Replace all particular values in a data frame
- ggplot2 manually specifying colour with geom_line
- How to update a package in R?
- Error: Invalid input: date_trans works with objects of class Date only
- Matrix expression causes error “requires numeric/complex matrix/vector arguments”?
- NAs are not allowed in subscripted assignments
- Non-conformable arrays error in code
- Unused arguments in R
- How to convert a data frame column to numeric type?
- Boxplot dplyr: Error: non-numeric argument to binary operator
- Function to calculate R2 (R-squared) in R
- Error: ggplot2 doesn’t know how to deal with data of class matrix?
- lmer error: grouping factor must be < number of observations
- Aggregate multiple columns at once
- installing data.table results in “there is no package”
- What is integer overflow in R and how can it happen?
- Creating box plot on exercise
- changing title in multiplot ggplot2 using grid.arrange
- How to split data into training/testing sets using sample function
- How to sort a data frame by alphabetic order of a character variable in R?
- Error in na.fail.default(as.ts(x)) : missing values in object in time series forecasting
- Error in contrib.url(repos, “source”) in R trying to use CRAN without setting a mirror Calls: install.packages -> contrib.url Execution halted
- Geometric Mean: is there a built-in?
- Error in xj[i] : invalid subscript type ‘list’
- Error in eval(predvars, data, env) : invalid ‘envir’ argument of type ‘character’
- How do you specifically order ggplot2 x axis instead of alphabetical order?
- IF “OR” multiple conditions
- Convert the values in a column into row names in an existing data frame
- How can I make a list of lists in R?
- Merge data frames based on rownames in R
- The difference between bracket [ ] and double bracket [[ ]] for accessing the elements of a list or dataframe
- Subset and ggplot2
- What is the meaning of the dollar sign “$” in R function()?
- How do I print a hexadecimal number with leading 0 to have width 2 using sprintf?
- How to deal with “data of class uneval” error from ggplot2?