R

Asked • 09/06/19

How to create an empty R vector to add new items?

I want to use R in Python, as provided by the module Rpy2. I notice that R has very convenient `[]` operations by which you can extract the specific columns or lines. How could I achieve such a function by Python scripts?My idea is to create an R vector and add those wanted elements into this vector so that the final vector is the same as that in R. I created a `seq()`, but it seems that it has an initial digit 1, so the final result would always start with the digit 1, which is not what I want. So, is there a better way to do this?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.