Comments (2)
Has anyone had issues running the code on page 31?
I keep getting the following error message.
Error in x[j] : invalid subscript type 'list'
from statistics-for-data-scientists.
I'm getting a different issue with the code on this page.
Running sp500_sym[sp500_sym$sector=="etf", 'symbol']
yields the etfs you find on page 32 when running corrplot in the book. HOWEVER, running
etfs <- sp500_spx[row.names(sp500_px)>"2012-07-01", sp500_sym[sp500_sym$sector=="etf", 'symbol]]
yields a different set of etfs.
i.e.
> sp500_sym[sp500_sym$sector=="etf", 'symbol']
> [1] XLI QQQ SPY DIA GLD VXX USO IWM XLE XLY XLU XLB XTL XLV XLP XLF XLK
but
> colnames(etfs)
[1] "VAR" "PBCT" "CINF" "ALLE" "JCI" "ENDP" "THC" "IPG" "SYK" "MCK" [11] "CERN" "STJ" "BXLT" "ESRX" "CAH" "TMO" "ZBH"
I admit that I am still learning R, so could it be something in the code? The data I used were the csv files from this github page and read with read.csv.
from statistics-for-data-scientists.
Related Issues (10)
- Empty!!! HOT 3
- Not able to download the dataset from Google drive HOT 4
- where is library ascii HOT 2
- I have a question about the code in chapter2.r
- When will the data used in the book be available ? HOT 5
- Missing /data/ directory; can be manually added before running download_data.r HOT 2
- Permutation Test Example: Web Stickiness
- about the data
- png files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statistics-for-data-scientists.