Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSymbols.PostgreSQL #90

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

AndreMikulec
Copy link

@AndreMikulec AndreMikulec commented Jun 5, 2016

If no symbols are found

for(i in 1:length(Symbols)) {
Browse[2]> 1:length(Symbols)
[1] 1 0

But then this is correct.

Browse[2]> seq_along(Symbols) # REPLACED
integer(0)

I made those changes everywhere in the file.

If no symbols are found

for(i in 1:length(Symbols)) {
Browse[2]> 1:length(Symbols)
[1] 1 0

But then this is correct.

Browse[2]> seq_along(Symbols) # REPLACED
integer(0)
Browse[2]>
Heavily based on getSymbols.MySQL.Rd, but it has some PostgreSQL specifics.
@AndreMikulec
Copy link
Author

Adds the function ( with documentation ) getSymbols.PostgreSQL

This very very similar to the getSymbols.MySQL code.

What is more/different follows.

This function can have PostgreSQL tables named MSFT returning symbols and columns MSFT and MSFT.Open. Also, this function can have PostgreSQL tables named msft returning symbols
and columns msft and msft.Open.. This is because PostgreSQL has case-senstive identifier names and an ugly required "NaMe" exists for upper case identifiers to be used SQL strings.
This lowercase-ism is meant as a slight user convenience. I warn users by making a comment in the .Rd that the lower case name msft is not recommended in the quantmod workflow ( I mean to say: so use uppercase PostgreSQL table names like MSFT and ignore the lowecase feature).

Two extra parameters may be passed: options and search_path.

options: is a pass-through to the RPostgreSQL connection.

search_path: allows the user to set a specific search path when looking for PostgreSQL tables.
This is somewhat PostgreSQL specific.

Otherwise, this is the same as the getSymbols.MySQL code.

@AndreMikulec AndreMikulec changed the title Replaced 1:length(Symbols) [1] 1 0 by seq_along(Symbols) getSymbols.PostgreSQL Jun 6, 2016
@AndreMikulec
Copy link
Author

Please close. I have implemented this elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant