Quantmod version 0.4.0
Function getSymbols returns empty dates when using Google as source, not using Yahoo.
Google data seems fine, checking http://www.google.com/finance/historical?cid=700196&startdate=Sep+30%2C+2010&enddate=Nov+1%2C+2010&num=30&ei=6sqlUoieA5SLsgfq5gE&output=csv
Reproducable with followong code:
library(quantmod)
Sys.setenv(TZ="UTC")
DataG <- getSymbols('XLF',src="google",auto.assign=FALSE, from = '2010-09-30', to = '2010-11-01')
DataG
DataY <- getSymbols('XLF',src="yahoo",auto.assign=FALSE, from = '2010-09-30', to = '2010-11-01')
DataY
Retested in version 0.4.1, still NA's in date!
DataG <- getSymbols('XLF',src="google",auto.assign=FALSE, from = '2010-09-30', to = '2010-11-01')
DataG
XLF.Open XLF.High XLF.Low XLF.Close XLF.Volume
2010-09-30 14.46 14.63 14.34 14.34 107539828
<NA> 14.49 14.55 14.34 14.50 132131830
<NA> 14.48 14.59 14.33 14.40 85547602
<NA> 14.53 14.78 14.42 14.73 133006599
<NA> 14.76 14.80 14.67 14.72 64754368
<NA> 14.79 14.84 14.58 14.66 71795649
<NA> 14.68 14.73 14.62 14.70 62422677
<NA> 14.71 14.73 14.62 14.68 41265794
<NA> 14.60 14.87 14.57 14.84 65831033
<NA> 14.94 15.00 14.82 14.86 112666954
<NA> 14.72 14.75 14.46 14.60 169232668
<NA> 14.64 14.72 14.25 14.34 132860239
<NA> 14.30 14.69 14.30 14.67 78307701
<NA> 14.56 14.77 14.41 14.47 146739470
<NA> 14.48 14.69 14.35 14.61 96600861
<NA> 14.67 14.78 14.49 14.61 73596983
<NA> 14.64 14.69 14.56 14.60 41264255
<NA> 14.73 14.75 14.53 14.55 45766940
<NA> 14.49 14.60 14.46 14.57 47408863
<NA> 14.52 14.63 14.47 14.58 62701109
<NA> 14.66 14.70 14.49 14.58 57911184
<NA> 14.54 14.59 14.48 14.56 39827062
2010-11-01 14.59 14.69 14.42 14.56 65746592
DataY <- getSymbols('XLF',src="yahoo",auto.assign=FALSE, from = '2010-09-30', to = '2010-11-01')
DataY
XLF.Open XLF.High XLF.Low XLF.Close XLF.Volume XLF.Adjusted
2010-09-30 14.46 14.63 14.34 14.35 107532900 13.65
2010-10-01 14.49 14.55 14.34 14.50 132129000 13.80
2010-10-04 14.48 14.59 14.33 14.40 85547600 13.70
2010-10-05 14.53 14.79 14.42 14.73 133006600 14.01
2010-10-06 14.76 14.80 14.67 14.72 64754400 14.01
2010-10-07 14.79 14.84 14.58 14.66 71794600 13.95
2010-10-08 14.68 14.73 14.62 14.70 62412700 13.99
2010-10-11 14.71 14.73 14.62 14.68 41265800 13.97
2010-10-12 14.60 14.87 14.57 14.85 65831100 14.13
2010-10-13 14.94 15.00 14.82 14.86 112667000 14.14
2010-10-14 14.72 14.75 14.46 14.60 169232700 13.89
2010-10-15 14.65 14.72 14.25 14.35 132854700 13.65
2010-10-18 14.30 14.69 14.30 14.67 78305300 13.96
2010-10-19 14.56 14.77 14.41 14.47 146739500 13.77
2010-10-20 14.48 14.69 14.35 14.61 96600900 13.90
2010-10-21 14.67 14.78 14.49 14.61 73588900 13.90
2010-10-22 14.64 14.69 14.56 14.60 41264300 13.89
2010-10-25 14.73 14.75 14.53 14.55 45766800 13.84
2010-10-26 14.49 14.60 14.46 14.57 47400100 13.86
2010-10-27 14.52 14.63 14.47 14.58 62701200 13.87
2010-10-28 14.66 14.70 14.49 14.58 57907600 13.87
2010-10-29 14.54 14.59 14.48 14.56 39826600 13.85
2010-11-01 14.59 14.69 14.42 14.56 65743100 13.85
installed.packages()["quantmod", "Version"]
[1] "0.4-1"
There is a problem with localization and date format. This works for me.
invisible(Sys.setlocale("LC_MESSAGES", "C"))
invisible(Sys.setlocale("LC_TIME", "C"))
Now try getSymbols with google as data source.
Related
I need to find the average of every 6 months, starting from v1 to v15. Now that i know that there are v15 columns hence its working with my below code. But there will more than 15 columns and I need a generic code that can solve the purpose.
Logic i am using is: taking the average of columns - 1:6 and printing, then 2:7 and so on- till 15, as i know there are 15 columns. But there will more columns in actual.
csv file:
V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15
1 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
2 0.04 0.04 0.04 0.04 0.04 0.04 0.04 0.11 0.04 0.04 0.04 0.04 0.04 0.04 0.04
3 3.29 3.56 3.97 3.23 2.96 2.35 0.06 1.72 2.19 1.92 1.84 2.87 2.57 2.24 3.06
4 11.79 15.01 14.76 13.19 18.29 4.51 16.24 11.92 10.49 13.05 12.74 12.95 12.25 14.46 14.27
5 20.11 21.76 21.92 23.67 19.87 25.59 23.04 16.67 22.78 21.32 20.85 21.57 21.99 22.69 22.96
6 24.85 26.56 29.45 24.96 25.91 16.31 27.51 22.56 28.35 26.96 26.53 28.23 28.24 29.85 29.79
7 29.02 32.75 29.95 27.7 29.6 17.91 32.08 25.71 33.16 31.56 30.89 32.68 34.05 36.26 33.27
8 32.83 33.09 17.03 33.23 31.22 39.71 35.43 28.77 37.09 34.18 34.05 36.98 37.16 38.74 37.32
9 32.86 36.34 35.47 33.6 35 42.79 37.22 30.62 38.74 35.83 36.17 39.48 39.18 42.87 39.54
10 36.02 37.66 36.15 34.79 36.84 22.19 38.9 32.62 40.28 37.87 38.09 41.04 41.62 44.94 42.18
11 36.96 39.22 19.13 36.68 37.43 46.26 40.84 33.88 41.31 39.09 39.14 43.46 42.75 47.2 43.8
12 37.34 40.87 35.91 37.66 39.22 46.95 42.26 35.19 42.93 41 40.61 44.73 45.2 48.14 44.49
13 38.92 38.37 41.01 39.01 41 48.89 43.8 37.16 44.1 42.46 41.3 45.47 46.65 50.48 47.6
14 21.67 43.16 20.98 39.84 42 49.62 44.35 37.46 44.63 43.15 42.64 48.48 48.53 53.55 48.57
a <- t(apply(mat,1,function(x){ c(mean(x[1:6]),mean(x[2:7]),mean(x[3:8]),mean(x[4:9]),mean(x[5:10]),mean(x[6:11]),mean(x[7:12]),mean(x[8:13]),mean(x[9:14]),mean(x[10:15])) }))
Please help. thanks in Advance.
We can do this with a rolling mean (rollmean
library(zoo)
t(apply(df1, 1, function(x) rollmean(x, 6)))
Using base R:
n=6
d=lapply(1:(ncol(data)-(n-1)),function(x) x:(x+n-1))
sapply(d,function(w) rowMeans(data[,w]))
another base solution:
rowlingRowMeans <- function(matrix, n_meanrows){
out <- NULL
for(z in 1:(nrow(matrix)-n_meanrows+2)){
out <- cbind(out, rowMeans(matrix[,z:(z+n_meanrows-1)]))
}
return(out)
}
mat <- matrix(rnorm(15*14, 1,10), ncol=15, nrow=14)
rowlingRowMeans(mat, 6)
I have loop to analysis of 25 time series, In the analysis I need to get the mean of the individual columns for each station , for example the mean of all the Januaries, the same for all the Februaries, etc., etc. To complicate matters the time series are not all the same length, for example station 1 might run from 1900 to 1955 while station 2 might run from 1881 to 1945. So I need the mean of a Januaries of station 1, the mean of all Februaries of Station 1, etc., etc. and the same process for station 2 etc., etc. My times do not all start in January or end in December, but can start and finish in any month, each time series is individual. To get the colMeans, I need to change the time series to a matrix, but I need to pad out the empty spaces with NAs. Now how can I do that and put the function into the loop
Below is an example of my data
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1951 15.50 18.74 22.75 25.90 25.43 27.61
1952 27.60 27.72 27.63 24.38 20.34 17.74 17.90 20.57 23.13 25.60 26.41 26.98
1953 25.80 26.19 24.99 23.23 19.59 15.78 14.85 18.97 20.44 25.78 26.65 27.00
1954 26.25 26.97 25.33 23.16 20.47 15.47 15.64 18.33 22.71 26.71 25.77 25.94
1955 26.69 25.36 24.19 23.42 19.65 17.10 17.36 18.67 20.95 24.41 24.93 26.12
1956 26.02 26.48 25.81 23.91 20.78 17.40 17.48 19.96 21.06 25.44 26.16 25.92
1957 26.67 28.03 25.24 24.40 19.89 16.54 17.99 19.01 24.81 26.18 28.38 26.96
1958 25.90 26.49 24.90 24.67 21.36 16.19 16.29 17.20 22.18 24.52 29.13 26.65
1959 26.53 26.65 25.17 24.26 20.67 17.56 18.11 18.49 21.50 26.21 26.48 27.52
1960 27.25 26.04 26.58 22.80 19.41 17.16 15.57 20.24 22.86 26.68 25.71 27.58
1961 26.79 25.88 26.19 24.22 22.09 17.77 17.91 18.56 23.27 24.94 25.68 26.66
1962 27.03 28.11 26.05 23.81 18.79 17.32 16.04 19.23 23.14 27.57 27.37 27.09
1963 26.91 26.68 24.97 22.87 18.71 16.79 16.05 18.25 23.52 25.73 27.08 26.86
1964 28.63 28.04 28.16 23.98 19.78 15.40 14.98 18.32 22.88 25.60 26.55 25.23
1965 27.77 28.87 26.62 23.40 19.49 15.62 17.14 19.79 22.09 23.44 26.32 28.40
1966 29.68 26.63 25.50 23.13 19.49 18.65 17.69 19.32 22.12 23.88 27.37 27.75
1967 27.84 26.46 25.75 24.20 20.15 17.22 15.64 18.39 22.41 25.38 27.42 27.62
1968 30.27 27.91 26.32 22.56 19.86 14.16 17.07 19.76 22.42 26.05 24.61 26.38
1969 28.72 30.04 25.85 23.68 20.09 18.32 16.85 19.61 22.10 24.97 27.28 25.46
1970 29.62 27.24 26.62 23.34 20.20 16.95 17.40 20.23 24.21 24.74 27.25 28.71
1971 26.25 26.44 28.15 25.31 19.14 16.21 16.92 19.12 23.09 24.28 24.43 27.19
1972 26.64 26.07 25.17 24.13 19.45 15.83 16.14 18.45 22.74 24.98 25.54 30.09
1973 30.44 28.54 28.10 22.80 20.36 18.05 16.74 19.16 23.56 24.64 25.97 25.50
1974 27.46 26.52 25.44 22.36 19.79 16.83 16.70 19.89 21.39 26.22 25.84 25.93
1975 27.84 25.91 24.42 22.87 20.90 16.42 16.25 18.79 23.24 24.54 27.07 26.97
1976 26.05 26.33 24.95 22.07 18.42 16.88 15.79 17.24 23.01 25.26 27.65 29.15
1977 30.00 26.31 23.47 23.17 20.21 17.23 16.12 18.80 23.55 25.93 26.97 26.68
1978 25.99 26.36 26.31 22.49 19.72 15.88 15.99 21.64 23.57 24.68 24.78 26.47
1979 26.98 28.17 25.36 24.06 20.65 17.64 15.98 19.89 22.63 25.40 25.31 27.03
1980 27.74 28.05 25.47 23.72 20.55 15.96
I have an SVG that is effectively being used as a 'mask'; it's displayed over the top of another div with a background image so that the image peeks through the unfilled areas of the SVG. The SVG itself is responsive to the height of the document (rather than the width). This works fine so far.
However, I've just been made aware that if you resize the (Chrome) browser, the background image overflows out of the bounds of the masking SVG; however, if you refresh the resized page, everything appears as expected - it only occurs on resize, and only in Chrome (oh, and Opera too, apparently). Works as expected in FF and Safari.
I've included a demo here (and a jsFiddle) with an inline SVG, however it doesn't seem to matter if it's inline or with an <img /> tag - the results are the same.
It seems to be somehow related to the containing element; if I open up the inspector and set the containing element's padding to 0 after it goes screwy, then it seems to figure itself out and suddenly appear as expected; however if I include that rule in the loaded CSS then it makes no difference. I even tried triggering similar CSS properties on page resize via Javascript, but it hasn't made any difference.
Am I missing something, or have I stumbled across a bug?
#splash {
position: relative;
height: 100vh;
padding: 3rem;
overflow: hidden;
display: flex;
-webkit-box-align: center;
align-items: center;
background-color: #DDDDDD;
}
#logowrapper {
position: relative;
width: auto;
height: 60%;
margin: auto;
}
#logowrapper .kitten {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-image: url('http://placekitten.com/200/300');
background-size: cover;
}
#logowrapper svg {
position: relative;
width: auto;
height: 100%;
z-index: 4;
}
<div id="splash">
<div id="logowrapper">
<div class="kitten"></div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 300" preserveAspectRatio="xMinYMin meet">
<defs/>
<g>
<path stroke="none" fill="#DDDDDD" d="M110.95 215.1 Q100 225.6 100 240.7 100 256.25 110.75 266.85 121.45 277.5 137 277.5 153.9 277.5 165.45 267.4 177 257.35 177 242.5 177 226.85 166.7 216.1 155.6 204.6 137.5 204.6 121.85 204.6 110.95 215.1 M82.9 206.15 L82.2 206.05 80.3 206.05 Q75.15 206.05 71.55 207.25 66.35 208.95 66.35 212.7 66.35 215.65 67.75 216.9 L69.25 218.45 Q69.25 220.6 67.05 223.4 64.85 226.1 64.05 226.1 L63.8 226.1 Q62.45 225.9 60.35 223.3 58.25 220.75 58.25 218.4 58.25 217.8 59.6 217.1 60.95 216.3 60.95 214.7 L60.85 213.3 Q60.35 210.15 57.05 208.5 53.7 206.9 50.15 206.9 L32.8 206.9 27.25 207.75 Q21.85 209.3 21.85 213.1 21.85 214.8 23.35 216.2 24.85 217.8 28.4 219.3 29.9 219.9 35.1 226.2 40.3 232.5 44.5 239.15 45.2 240.05 45.4 242.35 L45.6 248.15 45.4 255.5 45 261.5 Q45 263.1 42.8 264.65 38.2 267.8 38.2 269.6 38.2 274.8 45.2 275.9 L58.55 276.5 61.45 276.5 64.35 276.6 Q69.45 276.6 72.2 275.6 75.85 274.1 77.25 270.45 L77.45 269.1 Q77.45 267.2 75.15 265.6 70.45 262.25 70.45 259.55 L70.45 238.95 86.05 218.7 Q86.3 218.45 91.45 216.9 95.1 215.75 95.1 212.05 95.1 208.35 93.45 207.15 91.6 205.95 88.5 205.95 L85.65 206.05 82.9 206.15 M127.75 222.3 Q130.15 219.2 133.85 219.2 141.8 219.2 146.9 232 151 242.15 151 251.7 151 256.7 148.6 259.6 146.2 262.4 142.2 262.4 135.1 262.4 129.75 249.5 125.35 238.95 125.35 230.4 125.35 225.5 127.75 222.3 M127 174.1 Q127.35 173.5 128.35 173.5 132.6 173.5 132.6 178.95 132.6 183.25 129 183.25 127.35 183.25 126.95 181.7 126.7 180.85 126.7 178.2 L126.65 176.9 126.6 175.7 Q126.6 174.7 127 174.1 M126.85 160.15 Q127.2 159.3 128.05 159.3 131.5 159.3 131.5 164.2 131.5 168.75 127.95 168.75 127.1 168.75 126.8 167.9 126.45 167.1 126.45 165.75 L126.5 164.8 126.6 163.8 126.55 163.5 126.5 162.2 Q126.5 161 126.85 160.15 M111.95 158.35 Q112.35 159 113.1 159 114.4 159 115.05 161.55 115.65 164.15 115.65 168.15 115.65 173.9 114.65 179 113.65 184.1 112.3 184.1 111.75 184.1 111.55 184.55 L111.35 185.8 Q111.35 186.95 112.3 187.65 113.2 188.35 114.7 188.35 L119.6 188.2 124.9 188.05 129.2 188.2 133.15 188.35 Q139 188.35 142.5 185.45 145.95 182.6 145.95 177.7 145.95 173.8 142.8 171.8 139.6 169.85 139.6 169.4 L142 166.2 Q143.1 164.4 143.1 162.15 143.1 157.75 139.35 155.9 136.65 154.55 131.8 154.55 L127.55 154.65 121.75 154.75 118.8 154.65 114.9 154.55 Q113.4 154.55 112.45 155.25 111.5 155.95 111.5 157 111.5 157.75 111.95 158.35 M106.65 123.3 L103.7 123.4 97.65 123.4 95.55 123.65 Q95.05 123.9 95.05 124.6 95.05 125.15 95.75 125.45 96.4 125.7 96.6 126 97.15 127.2 97.15 131.75 L97.05 134.45 96.8 136.4 Q96.6 137.2 95.9 137.6 95.2 137.95 95.2 138.45 95.2 139.45 96.45 139.45 L106.35 139.45 108.1 139.65 109.05 139.7 Q109.8 139.7 110.55 137.9 L111.2 135.45 110.9 134.3 Q110.55 133.9 110.05 133.9 109.7 133.9 108.65 135.5 107.5 137.1 104.5 137.1 102.9 137.1 102.55 136.65 102.25 136.15 102.25 133.95 102.25 133 102.4 132.65 102.6 132.35 103.15 132.35 104.35 132.35 104.65 133.55 104.9 134.75 105.45 134.75 106.15 134.75 106.6 133.75 107 132.7 107 131.05 107 129.4 106.65 128.5 106.25 127.6 105.6 127.6 104.8 127.6 104.6 128.85 104.35 130.1 103.5 130.1 L102.3 129.95 Q102.05 129.8 102.05 129.05 L102.05 127.05 Q102.05 126.2 102.45 125.9 L104 125.65 Q107.05 125.65 108 127.2 L109 127.85 Q110.25 127.85 110.25 126.2 110.25 124.95 109.65 123.95 109.1 122.95 108.4 122.95 L106.65 123.3 M150.65 132.95 L149.4 132.85 148.85 132.5 Q148.85 132.05 149.45 130.75 150 129.5 150.4 129.5 L151.55 130.75 Q152.3 132.05 152.3 132.55 L151.85 132.85 150.65 132.95 M158.5 133.55 Q156.15 128.3 155.2 126.7 153 123.05 150.85 123.05 148.25 123.05 148.25 126 L147.2 129.6 Q146.05 132.8 144.95 134.8 143.55 137.4 142.8 137.4 142.3 137.4 142.1 137.7 141.95 137.95 141.95 138.35 141.95 139.1 142.75 139.4 L145.5 139.7 Q148.9 139.7 148.9 138.3 148.9 137.75 148.2 137.5 147.45 137.2 147.45 136.9 147.45 136.1 147.85 135.9 L149.95 135.65 150.55 135.65 152.8 135.85 Q153.55 136.05 153.55 136.75 L153.1 137.3 Q152.15 137.75 152.15 138.35 152.15 139.25 153.5 139.45 L157.4 139.7 160.8 139.3 Q161.8 138.95 161.8 138.05 161.8 137.25 160.95 137.25 160.2 137.25 158.5 133.55 M125.05 123.2 L122.1 123.6 Q121.05 124.05 121.05 124.8 121.05 125.6 121.55 125.8 122.3 126.15 122.65 127.1 L126.95 138.15 Q127.3 139.05 127.75 139.4 128.15 139.75 128.9 139.75 130.15 139.75 131.15 137.75 L132.5 134.15 Q133.15 132.2 133.65 132.2 134.25 132.2 134.95 134.15 L136.25 137.75 Q137.2 139.7 138.45 139.7 139.2 139.7 139.65 139.15 L140.85 136.8 144.35 127.65 Q144.95 126.15 145.5 125.6 146.2 125 146.2 124.6 146.2 123.15 143.5 123.15 141.8 123.15 141 123.5 140.25 123.8 140.25 124.5 140.25 125.25 141 125.55 141.75 125.85 141.75 126.25 L141.05 128.7 Q140.35 130.45 139.95 130.45 139.6 130.45 138.7 128.75 137.8 127.05 137.8 126.15 L138.1 125.55 138.8 124.55 Q138.8 123.85 137.8 123.5 L134.45 123.2 Q130 123.2 130 124.65 130 125.2 130.95 126.05 131.95 126.9 131.95 127.6 L131.6 129.15 Q131.15 130.7 130.5 130.7 130.1 130.7 129.3 128.55 128.55 126.6 128.55 126.15 L128.75 125.6 129.1 124.65 Q129.1 123.8 128.25 123.5 L125.05 123.2 M58.85 159.05 Q53.65 164.05 53.65 171.25 53.65 178.65 58.75 183.7 63.85 188.75 71.25 188.75 79.3 188.75 84.8 183.95 90.3 179.15 90.3 172.1 90.3 164.65 85.4 159.55 80.1 154.05 71.5 154.05 64.05 154.05 58.85 159.05 M69.75 161 Q73.55 161 76 167.1 77.95 171.95 77.95 176.5 77.95 178.85 76.8 180.25 75.65 181.6 73.75 181.6 70.35 181.6 67.8 175.45 65.7 170.4 65.7 166.35 65.7 164 66.85 162.5 68 161 69.75 161 M25.65 154.5 L24.4 154.2 Q21.85 154.2 19.85 157.7 18.1 160.75 18.1 163.25 18.1 164.7 18.8 165.85 19.45 167 20.65 167 22.7 167 24.8 164.3 26.9 161.6 27.55 161.6 28.6 161.6 29 162.95 29.4 164.35 29.4 166.75 L29.3 169.4 29.2 172.6 29 176.6 28.3 180.95 Q28.1 181.7 26.3 182.65 24.5 183.6 24.5 184.55 24.5 186.9 28.1 187.75 L34.9 188.3 Q40.5 188.3 42.7 187.3 44.95 186.35 44.95 184.7 44.95 183.35 43.15 182.65 41.4 182 41.2 181.25 40.55 178.55 40.4 177.05 L40.2 173 Q40.2 169 40.5 165.25 40.8 161.5 41.4 161.5 43.35 161.5 44.6 164.15 45.85 166.8 48.4 166.8 49.9 166.8 50.95 165.65 52 164.5 52 162.9 52 160.4 50.6 157.45 48.95 154.05 46.6 154.05 L46.3 154.05 45.35 154.35 44.15 154.7 26.95 154.8 25.65 154.5 M29.4 123.45 L28.55 123.45 Q26.1 123.45 25.05 123.95 24.2 124.35 24.2 125.1 24.2 125.45 24.65 125.8 25.65 126.55 25.75 127.3 L25.85 129.35 25.85 129.75 25.85 130.15 25.75 132.8 25.7 135.35 Q25.7 136.4 24.5 137.05 23.95 137.35 23.95 137.75 23.95 138.9 25.25 139.25 L27.9 139.5 28.65 139.5 31.45 139.3 Q32.9 139 32.9 138.2 32.9 137.65 32.2 136.95 L31.4 135.8 31.35 134.15 31.25 132.35 31.4 129.05 31.5 127.1 Q31.5 126.8 32.45 125.9 32.9 125.5 32.9 124.95 32.9 123.95 31.8 123.65 L29.4 123.45 M43.05 123.3 L41.3 123.1 Q38.5 123.1 36.6 124.65 34.7 126.25 34.7 128.6 34.7 130.8 36.75 132.3 37.7 133 40.5 134.2 42.55 135.1 42.55 135.75 42.55 136.25 42 136.55 L40.6 136.85 Q38.35 136.85 37.05 135.05 35.7 133.25 35.25 133.25 34.25 133.25 34.25 134.55 34.25 137.15 35.6 138.3 37.2 139.75 41.45 139.75 44.7 139.75 46.75 138.2 48.8 136.6 48.8 134.05 48.8 131.65 46.75 130.35 45.95 129.85 42.95 128.8 40.9 128.1 40.9 127.2 40.9 126.65 41.3 126.35 41.7 126.05 42.35 126.05 43.55 126.05 45.05 127.35 46.55 128.7 47.2 128.7 47.75 128.7 48.15 128.2 48.55 127.75 48.55 127.1 48.55 126.1 47.75 124.85 46.95 123.45 46 123.45 L45.4 123.6 44.9 123.75 43.05 123.3 M80 123.35 L77.15 123.6 Q75.65 123.95 75.65 125 75.65 125.55 76.15 125.75 L77.1 126.45 77.35 127.6 77.4 130.25 77.25 134.5 76.8 136.8 76 137.15 Q75.5 137.3 75.5 137.9 75.5 138.95 76.95 139.35 L79.6 139.6 82.45 139.3 Q84.05 138.9 84.05 138.05 L84.05 137.95 Q84.05 137.5 83.6 137.15 82.5 136.35 82.5 134.5 82.5 133.45 82.8 133.05 83.25 132.5 84.7 132.5 L86.4 132.7 Q86.75 132.9 86.75 133.45 L86.7 133.9 86.7 134.35 Q86.7 136.55 85.65 137.2 85.2 137.5 85.2 138.2 85.2 138.95 86.6 139.4 L89.1 139.7 91.4 139.6 Q93.75 139.3 93.75 138.05 93.75 137.5 93.25 137.3 92.25 136.85 92.25 132.5 92.25 126.5 93.45 125.75 94 125.4 94 124.85 94 124 92.65 123.6 L90.15 123.25 87.8 123.4 Q85.3 123.75 85.3 124.9 85.3 125.3 86.05 125.9 86.8 126.5 86.8 128.1 L86.65 129.45 Q86.5 129.75 85.8 129.75 L85.35 129.7 84.9 129.7 84.4 129.75 83.95 129.75 Q83.2 129.75 82.95 129.45 82.6 129.1 82.6 128.05 82.6 126.45 83.8 125.75 84.2 125.45 84.2 124.95 L84.2 124.85 Q84.1 123.85 82.65 123.5 L80 123.35 M62.25 123.35 L61.65 123.15 Q60.45 123.15 59.5 124.85 58.65 126.3 58.65 127.5 58.65 128.2 59 128.75 59.3 129.35 59.85 129.35 60.85 129.35 61.85 128 62.85 126.75 63.2 126.75 63.7 126.75 63.9 127.4 L64.05 129.2 64 130.45 64 132 63.9 133.95 63.55 136 62.6 136.85 Q61.75 137.3 61.75 137.75 61.75 138.9 63.45 139.3 L66.7 139.55 70.45 139.05 Q71.5 138.6 71.5 137.8 71.5 137.2 70.7 136.85 69.85 136.5 69.75 136.15 L69.35 134.15 69.25 132.2 Q69.25 130.3 69.4 128.5 69.55 126.7 69.85 126.7 70.75 126.7 71.35 127.95 71.95 129.25 73.2 129.25 73.9 129.25 74.4 128.65 74.9 128.1 74.9 127.35 74.9 126.15 74.25 124.75 73.45 123.1 72.35 123.1 L72.2 123.1 71.75 123.25 71.15 123.4 62.9 123.45 62.25 123.35 M24.6 90.45 Q21.7 90.45 21.7 94.35 21.7 102.15 25.7 105.65 30.55 110.05 43.2 110.05 53 110.05 59.2 105.3 65.35 100.55 65.35 92.95 65.35 85.7 59.2 81.75 56.8 80.25 47.7 77.15 41.55 75.05 41.55 72.35 41.55 70.65 42.8 69.75 44 68.85 46 68.85 49.6 68.85 54.05 72.8 58.5 76.8 60.5 76.8 62.2 76.8 63.35 75.4 64.5 74.05 64.5 72.05 64.5 69 62.2 65.25 59.7 61.15 56.95 61.15 56.25 61.15 55.15 61.6 L53.55 62.05 48 60.6 42.8 60 Q34.4 60 28.7 64.75 23 69.5 23 76.5 23 83.15 29.1 87.7 32 89.75 40.45 93.4 46.5 96 46.5 98 46.5 99.45 44.9 100.35 43.25 101.3 40.75 101.3 33.95 101.3 30 95.85 26.05 90.45 24.6 90.45 M24.1 34.7 Q24.1 33.75 24.95 33.75 26.55 33.75 26.55 36.05 26.55 38.25 24.6 38.25 24.2 38.25 24.1 38.1 23.95 37.9 23.95 37.5 L24.1 34.7 M19.6 31.3 Q16.95 31.3 16.95 32.7 16.95 33.2 17.5 33.45 18.7 33.95 18.7 37 L18.65 41.9 Q18.65 44.55 17.5 45.25 16.95 45.6 16.95 46.05 16.95 47.7 21.3 47.7 L24.6 47.35 Q25.6 47.05 25.6 46.25 25.6 45.7 25.1 45.4 24.1 44.8 24.1 42.25 L24.1 41.95 24.2 41.15 Q24.3 40.75 24.8 40.75 26.05 40.75 26.6 42.6 27.5 45.7 27.75 46.05 28.85 47.9 31.5 47.9 L34.15 47.45 Q35.15 46.95 35.15 46.15 35.15 45.6 34.35 45.3 33.5 45 33.4 43.9 33.1 41.6 32.1 40.55 31.2 39.55 30.2 39.2 L31.75 37.75 Q32.5 36.85 32.5 35.45 32.5 33.55 30.95 32.4 29.4 31.2 26.85 31.2 L24.05 31.4 22.35 31.45 21 31.35 19.6 31.3 M76.35 33.8 Q77.4 33.8 78 34.5 78.6 35.2 78.6 36.45 78.6 37.7 78.05 38.35 77.5 39 76.5 39 L75.7 38.8 75.45 38.25 75.45 34.25 Q75.45 33.8 76.35 33.8 M42.9 33.9 L44.45 33.65 Q47.5 33.65 48.45 35.2 48.85 35.85 49.45 35.85 50.7 35.85 50.7 34.2 50.7 32.95 50.1 31.95 49.55 30.95 48.85 30.95 L47.1 31.3 44.15 31.4 38.1 31.4 36 31.65 Q35.5 31.9 35.5 32.6 35.5 33.15 36.2 33.45 L37.05 34 Q37.6 35.2 37.6 39.75 L37.5 42.45 37.25 44.4 Q37.05 45.2 36.35 45.6 35.65 45.95 35.65 46.45 35.65 47.45 36.9 47.45 L46.8 47.45 48.55 47.65 49.5 47.7 Q50.25 47.7 51 45.9 L51.65 43.45 51.35 42.3 Q51 41.9 50.5 41.9 50.15 41.9 49.1 43.5 47.95 45.1 44.95 45.1 43.35 45.1 43 44.65 42.7 44.15 42.7 41.95 42.7 41 42.85 40.65 43.05 40.35 43.6 40.35 44.8 40.35 45.1 41.55 45.35 42.75 45.9 42.75 46.6 42.75 47.05 41.75 47.45 40.7 47.45 39.05 47.45 37.4 47.1 36.5 46.7 35.6 46.05 35.6 45.25 35.6 45.05 36.85 44.8 38.1 43.95 38.1 L42.75 37.95 Q42.5 37.8 42.5 37.05 L42.5 35.05 Q42.5 34.2 42.9 33.9 M55.05 32.65 Q53.15 34.25 53.15 36.6 53.15 38.8 55.2 40.3 56.15 41 58.95 42.2 61 43.1 61 43.75 61 44.25 60.45 44.55 L59.05 44.85 Q56.8 44.85 55.5 43.05 54.15 41.25 53.7 41.25 52.7 41.25 52.7 42.55 52.7 45.15 54.05 46.3 55.65 47.75 59.9 47.75 63.15 47.75 65.2 46.2 67.25 44.6 67.25 42.05 67.25 39.65 65.2 38.35 64.4 37.85 61.4 36.8 59.35 36.1 59.35 35.2 59.35 34.65 59.75 34.35 60.15 34.05 60.8 34.05 62 34.05 63.5 35.35 65 36.7 65.65 36.7 66.2 36.7 66.6 36.2 67 35.75 67 35.1 67 34.1 66.2 32.85 65.4 31.45 64.45 31.45 L63.85 31.6 63.35 31.75 61.5 31.3 59.75 31.1 Q56.95 31.1 55.05 32.65 M117.5 61.3 L111.75 61 Q107 61 104.5 61.75 100.8 62.8 100.8 65.6 100.8 66.9 102.85 68.15 104.25 68.9 104.25 69.75 L104.1 70.2 98.1 84.15 97.2 84.4 Q96.25 84.4 96.05 83.9 L90.55 70.55 90.5 70.2 Q90.5 69.45 91.95 68.65 93.6 67.7 93.6 65.9 93.6 62.45 89.2 61.65 L80.95 61 79.7 60.85 78.4 60.85 Q73.8 60.85 70.4 62.3 66.95 63.75 66.95 66.5 66.95 68.15 69.35 69.1 71.6 70.1 72.05 70.95 L76.25 80.65 83.75 98.3 Q87.8 107.75 88.35 107.75 88.85 108.9 90.2 109.55 91.5 110.25 92.95 110.25 96.4 110.25 97.5 107.85 98.4 107.85 104.85 94 110.9 80.85 115.05 70.55 115.75 68.9 118.05 68.35 120.4 67.8 120.4 65.45 120.4 61.95 117.5 61.3 M115.25 32.9 Q115.25 33.5 115.95 33.9 116.65 34.3 116.75 34.65 L116.9 35.5 116.95 36.45 Q116.95 37.9 116.25 37.9 115.9 37.9 115 37.2 114.45 36.75 112.85 35.3 L110.1 32.7 Q109.3 31.95 108.75 31.75 L107.5 31.5 107.2 31.5 106.55 31.5 104.15 31.8 Q102.9 32.2 102.9 33.1 102.9 33.5 103.5 33.85 L104.4 34.5 104.95 36.85 105.15 39.3 105 42 104.6 44.7 103.75 45.45 103.35 46.15 Q103.35 46.9 104.45 47.3 L106.6 47.65 Q108.3 47.65 109.2 47.15 109.9 46.8 110.05 46.05 110.05 45.65 109.65 45.3 L108.85 44.7 108.45 43.4 108.25 41.8 108.45 40.55 Q108.6 40.1 108.9 40.1 109.6 40.1 111.8 42.05 L115.65 45.7 Q117.8 47.65 118.5 47.65 119.25 47.65 119.6 46.5 119.9 45.4 119.9 41.25 L120 37.35 Q120.1 35.8 120.35 34.7 120.45 34.35 120.95 34.1 121.95 33.55 121.95 32.8 121.95 32 120.95 31.65 L119.3 31.45 118.9 31.45 118.75 31.45 118.7 31.45 118.4 31.45 116.45 31.7 Q115.25 32.05 115.25 32.9 M90.55 37 Q90.55 35.9 91.1 35.15 91.65 34.45 92.5 34.45 94.3 34.45 95.45 37.35 96.4 39.7 96.4 41.85 96.4 43 95.85 43.7 95.3 44.3 94.4 44.3 92.75 44.3 91.55 41.35 90.55 38.95 90.55 37 M83.9 36.35 Q83.9 34.1 82.2 32.65 80.5 31.25 77.75 31.25 L73.65 31.5 71.2 31.6 70.55 31.55 69.95 31.55 68.55 31.8 Q68.05 32 68.05 32.65 68.05 33.4 68.75 33.6 70.2 34 70.2 35.75 L70.2 43.2 Q70.2 44.95 69.05 45.5 68.5 45.75 68.5 46.2 68.5 47.7 72.7 47.7 77.15 47.7 77.15 46.15 77.15 45.8 76.35 45.25 75.45 44.65 75.45 43.85 L75.4 41.85 Q75.4 41.45 76.15 41.45 L76.85 41.5 77.8 41.6 Q80.5 41.6 82.2 40.15 83.9 38.65 83.9 36.35 M100 33.75 Q97.45 31.1 93.3 31.1 89.75 31.1 87.25 33.5 84.75 35.9 84.75 39.35 84.75 42.9 87.2 45.35 89.65 47.75 93.2 47.75 97.05 47.75 99.7 45.45 102.35 43.15 102.35 39.75 102.35 36.2 100 33.75 M139.25 33.8 Q140.25 34.55 140.35 35.3 L140.45 37.35 140.45 37.75 140.45 38.15 140.35 40.8 140.3 43.35 Q140.3 44.4 139.1 45.05 138.55 45.35 138.55 45.75 138.55 46.9 139.85 47.25 L142.5 47.5 143.25 47.5 146.05 47.3 Q147.5 47 147.5 46.2 147.5 45.65 146.8 44.95 146.1 44.3 146 43.8 L145.95 42.15 145.85 40.35 146 37.05 146.1 35.1 Q146.1 34.8 147.05 33.9 L147.5 32.95 Q147.5 31.95 146.4 31.65 L144 31.45 143.15 31.45 Q140.7 31.45 139.65 31.95 138.8 32.35 138.8 33.1 138.8 33.45 139.25 33.8 M136.45 32.85 Q135.65 31.45 134.7 31.45 L134.1 31.6 133.6 31.75 131.75 31.3 130 31.1 Q127.2 31.1 125.3 32.65 123.4 34.25 123.4 36.6 123.4 38.8 125.45 40.3 126.4 41 129.2 42.2 131.25 43.1 131.25 43.75 131.25 44.25 130.7 44.55 L129.3 44.85 Q127.05 44.85 125.75 43.05 124.4 41.25 123.95 41.25 122.95 41.25 122.95 42.55 122.95 45.15 124.3 46.3 125.9 47.75 130.15 47.75 133.4 47.75 135.45 46.2 137.5 44.6 137.5 42.05 137.5 39.65 135.45 38.35 134.65 37.85 131.65 36.8 129.6 36.1 129.6 35.2 129.6 34.65 130 34.35 130.4 34.05 131.05 34.05 132.25 34.05 133.75 35.35 135.25 36.7 135.9 36.7 136.45 36.7 136.85 36.2 137.25 35.75 137.25 35.1 137.25 34.1 136.45 32.85 M177.65 155.8 Q176.45 153.75 175 153.75 L171.4 154.4 165.2 154.7 152.6 154.7 148.3 155.15 Q147.25 155.65 147.25 157.15 147.25 158.35 148.65 158.9 150.05 159.45 150.4 160.1 151.6 162.6 151.6 172.1 L151.4 177.7 150.85 181.7 Q150.45 183.45 149 184.2 147.5 184.95 147.5 186 147.5 188.1 150.1 188.1 L170.8 188.1 174.4 188.45 176.35 188.6 Q178 188.6 179.55 184.85 180.85 181.7 180.85 179.75 180.85 178.3 180.2 177.4 179.55 176.5 178.5 176.5 177.75 176.5 175.5 179.85 173.2 183.25 166.9 183.25 163.55 183.25 162.85 182.25 162.2 181.25 162.2 176.6 162.2 174.65 162.55 173.95 162.95 173.3 164.05 173.3 166.65 173.3 167.2 175.8 167.75 178.3 168.9 178.3 170.35 178.3 171.25 176.2 172.15 174.1 172.15 170.65 172.15 167.2 171.35 165.3 170.55 163.4 169.15 163.4 167.55 163.4 167.1 166 166.65 168.65 164.85 168.65 L162.3 168.3 Q161.8 168 161.8 166.45 L161.85 162.3 Q161.85 160.5 162.65 159.9 163.4 159.35 165.85 159.35 172.2 159.35 174.15 162.55 175 163.95 176.25 163.95 178.85 163.95 178.85 160.5 178.85 157.9 177.65 155.8 M173.1 123.45 L172.65 123.45 170.65 123.7 Q169.45 124.1 169.45 124.95 169.45 125.65 169.8 125.9 L170.15 126.3 169.65 127.4 168.95 128 168.9 128 Q168.55 128 168.1 127.4 167.6 126.8 167.6 126.25 L167.95 125.95 168.25 125.4 168.2 125.1 Q168.1 124.4 167.35 124 166.6 123.65 165.75 123.65 L161.8 123.65 160.55 123.85 Q159.3 124.2 159.3 125.05 159.3 125.45 159.65 125.75 160 126.15 160.8 126.45 L162.35 128.05 164.45 131 164.7 131.75 164.75 133.05 164.7 134.75 164.6 136.1 164.1 136.85 Q163.05 137.55 163.05 137.95 163.05 139.15 164.65 139.4 L167.7 139.55 168.35 139.55 169 139.55 170.8 139.35 Q171.65 139 171.95 138.15 L172 137.85 Q172 137.4 171.5 137.05 170.4 136.3 170.4 135.65 L170.4 130.95 174 126.35 175.2 125.9 Q176.05 125.65 176.05 124.8 176.05 123.95 175.65 123.7 175.25 123.4 174.55 123.4 L173.9 123.45 173.25 123.45 173.1 123.45 M165.9 61 L164.2 61.35 161.45 62.1 154.65 60.35 Q151.4 59.55 149.2 59.55 139 59.55 130.85 67.65 122.7 75.7 122.7 85.05 122.7 96.6 130.45 103.5 138.15 110.4 150.5 110.4 164.5 110.4 170.3 101 L173.55 94.1 177.15 92.7 Q178.6 91.85 178.6 90.2 178.6 87 173.95 85.5 170.4 84.35 164.8 84.35 158.15 84.35 154.7 85.35 149.8 86.8 149.8 90.5 149.8 93.3 153.6 93.75 157.45 94.2 157.45 96.25 157.45 98.05 156.35 99.3 155.2 100.6 153.25 100.6 148.8 100.6 144.9 94.55 141.05 88.55 141.05 82.45 141.05 77.3 143.15 73.7 145.8 69.35 150.8 69.35 154.85 69.35 159.1 74.05 163.35 78.75 166.95 78.75 169.15 78.75 170.65 77 172.1 75.3 172.1 72.95 172.1 69.65 170.55 65.75 168.6 61 165.9 61 M165.3 31.5 L163.4 31.4 160.95 31.65 Q159.75 32 159.75 32.95 159.75 33.4 160.4 33.8 L160.9 34.35 160.85 34.5 158.85 39.15 158.55 39.2 158.15 39.05 156.3 34.6 156.3 34.5 Q156.3 34.25 156.8 33.95 157.35 33.65 157.35 33.05 157.35 31.9 155.85 31.65 L153.1 31.4 152.7 31.35 152.25 31.35 Q150.75 31.35 149.6 31.85 148.45 32.35 148.45 33.25 148.45 33.8 149.25 34.1 150 34.45 150.15 34.75 L151.55 37.95 154.05 43.85 155.6 47 Q155.75 47.4 156.2 47.6 L157.1 47.85 Q158.25 47.85 158.65 47.05 158.95 47.05 161.1 42.4 L164.5 34.6 Q164.7 34.05 165.5 33.85 166.25 33.7 166.25 32.9 166.25 31.75 165.3 31.5 M174.1 33.9 L175.65 33.65 Q178.7 33.65 179.65 35.2 L180.65 35.85 Q181.9 35.85 181.9 34.2 181.9 32.95 181.3 31.95 180.75 30.95 180.05 30.95 L178.3 31.3 175.35 31.4 169.3 31.4 167.2 31.65 Q166.7 31.9 166.7 32.6 166.7 33.15 167.4 33.45 168.05 33.7 168.25 34 168.8 35.2 168.8 39.75 L168.7 42.45 168.45 44.4 Q168.25 45.2 167.55 45.6 166.85 45.95 166.85 46.45 166.85 47.45 168.1 47.45 L178 47.45 179.75 47.65 180.7 47.7 Q181.45 47.7 182.2 45.9 182.85 44.4 182.85 43.45 182.85 42.75 182.55 42.3 182.2 41.9 181.7 41.9 181.35 41.9 180.3 43.5 179.15 45.1 176.15 45.1 174.55 45.1 174.2 44.65 173.9 44.15 173.9 41.95 173.9 41 174.05 40.65 174.25 40.35 174.8 40.35 176 40.35 176.3 41.55 176.55 42.75 177.1 42.75 177.8 42.75 178.25 41.75 178.65 40.7 178.65 39.05 178.65 37.4 178.3 36.5 177.9 35.6 177.25 35.6 176.45 35.6 176.25 36.85 176 38.1 175.15 38.1 L173.95 37.95 Q173.7 37.8 173.7 37.05 L173.7 35.05 Q173.7 34.2 174.1 33.9 M200 0 L200 300 0 300 0 0 200 0"/>
</g>
</svg>
</div>
</div>
If you want to use a responsive inline SVG in your HTML, the SVG shouldn't have width and height attributes.
Update:
Maybe It's a bug on Blink (or Webkit). And I tried to use a redraw hack.
https://jsfiddle.net/pbg1g4uv/2/
#logowrapper svg {
position: relative;
width: auto;
height: 100%;
z-index: 4;
animation: redraw 1s infinite;
}
#keyframes redraw {
from { min-width: 1px; }
to { min-width: 2px; }
}
I'm trying to use cor() to return the most correlated elements in order of their correlation. I wrote this function adapting cor() to do it and it works perfectly, but only when I run it on a big input. When I try and run it on a small input, I get a missing value where TRUE/FALSE needed error and I don't understand why?
Here is an example of my input data:
This can be directly copied into R(printed via write.table):
"Col2" "Col3" "Col4" "Col5" "Col6"
"Market Capitalization" NA NA 17082.69 17879.8 16266.11
"Cash & Equivalents" NA NA 747 132 394
"Preferred & Other" NA NA 0 0 0
"Total Debt" NA NA 12379 11982 11309
"Enterprise Value" NA NA 28714.69 29729.8 27181.11
"Total Revenue" 2896.75 3461.25 2818 3184 2901
"Growth % YoY" -0.15 0.68 1.7 3.44 -0.48
"Gross Profit" NA NA 1874 2080 1981
"Margin %" NA NA 66.5 65.33 68.29
"EBITDA" 758 1074 641 777 699
"Margin %1" 26.17 31.03 22.75 24.4 24.1
"Net Income Before XO" 214.5 410 172 192 207
"Margin %2" 7.4 11.85 6.1 6.03 7.14
"Adjusted EPS" 0.7 1.42 0.59 1.07 0.69
"Growth % YoY1" 0.72 -1.67 -3.28 5.94 -6.76
"Cash from Operations" 375.79 812.21 991 -84 961
"Capital Expenditures" NA NA -660 -676 -608
"Free Cash Flow" NA NA 331 -760 353
"Adjusted Price" 2094.66 3689.2 3805.62 3588.42 3582.4
This is the mycor() function I wrote
mycor<-function(dataset, relative.to=19, neg.cor=0){
#This takes the dataset (as a matrix) and computes the best correleted value
#and returns the row (variable ID) that is the most strongly correlated
#to the variable row referenced by relative.to. Use neg.cor = 1 for neg correlation
if(neg.cor == 0){
best.cor <- -1.0 #Have to get better correlation then this
best.cor.row <- integer() #The row with the best correlation
all.cor <- numeric() #The correlation for everything else
index <- 1 #The index for the all.cor array
for(i in 1:nrow(dataset)){
if(i != relative.to){ #No self correlation
temp.cor <- cor(dataset[i,], dataset[relative.to,], use = "na.or.complete")
all.cor[index] <- temp.cor
index <- index+1 #I wish the ++ opperator worked in R...
cat(best.cor)
pause()
if(temp.cor > best.cor){ #This remembers the best seen cor value
best.cor <- temp.cor
best.cor.row <- i
} #End inner if
} #End outter if
} #End for loop
}else{
best.cor <- 1.0 #Have to get better correlation then this
best.cor.row <- integer() #The row with the best correlation
all.cor <- numeric() #The correlation for everything else
index <- 1 #The index for the all.cor array
for(i in 1:nrow(dataset)){
if(i != relative.to){ #No self correlation
temp.cor <- cor(dataset[i,], dataset[relative.to,], use = "na.or.complete")
all.cor[index] <- temp.cor
index <- index+1 #I wish the ++ opperator worked in R...
if(temp.cor < best.cor){ #This remembers the worst seen cor value
best.cor <- temp.cor
best.cor.row <- i
} #End inner if
} #End outter if
} #End for loop
} #End else
return(list(all.cor = all.cor, best.cor.row = best.cor.row))
)
When I try and run this I get: Error in if (temp.cor > best.cor) { : missing value where TRUE/FALSE needed. The part about this that is strange, is that the mycor function works perfectly and gives no error when I give it a larger chunk of the same data set.
This is the larger chunk of the same data set.
This can also be copied into R(printed via write.table):
"Col2" "Col3" "Col4" "Col5" "Col6" "Col7" "Col8" "Col9" "Col10" "Col11" "Col12" "Col13" "Col14" "Col15" "Col16" "Col17" "Col18" "Col19" "Col20" "Col21" "Col22" "Col23" "Col24" "Col25" "Col26" "Col27" "Col28" "Col29" "Col30" "Col31" "Col32" "Col33" "Col34" "Col35" "Col36" "Col37" "Col38" "Col39" "Col40" "Col41" "Col42" "Col43" "Col44" "Col45" "Col46" "Col47" "Col48" "Col49" "Col50" "Col51" "Col52" "Col53" "Col54" "Col55" "Col56" "Col57" "Col58" "Col59" "Col60" "Col61" "Col62" "Col63" "Col64" "Col65" "Col66" "Col67" "Col68" "Col69" "Col70" "Col71" "Col72" "Col73" "Col74" "Col75" "Col76" "Col77" "Col78" "Col79" "Col80" "Col81" "Col82" "Col83" "Col84" "Col85" "Col86" "Col87" "Col88" "Col89" "Col90" "Col91" "Col92" "Col93" "Col94" "Col95" "Col96" "Col97" "Col98" "Col99" "Col100" "Col101" "Col102" "Col103" "Col104" "Col105" "Col106" "Col107" "Col108" "Col109" "Col110" "Col111"
"Market Capitalization" NA NA 17082.69 17879.8 16266.11 17540.1 18214.39 17110.13 18167.87 16700.24 15592.71 14824.06 14455.42 13685.56 12168.31 12550.1 12771.45 11273.2 10284.48 10863.21 10655.99 11750.74 10671.37 10818.32 13288.42 12558.8 12221.79 13213.51 12375.92 11854.12 10942.65 10689.79 11364.1 11887.9 11426.1 10249.34 10609.99 10167.51 9600.1 10001.68 9713.38 9184.3 9730.33 8249.64 9160.61 8586.38 8894.55 8908.81 11887.9 11426.1 10249.34 10609.99 10167.51 9600.1 10001.68 9713.38 9184.3 9730.33 8249.64 9160.61 8586.38 8894.55 8908.81 8566.69 8641.04 8444.84 7867.83 8163.04 7238.2 6279.55 6173.33 7376.47 9048.75 10095.35 10351.52 12311.04 12006.02 10785.58 11009.16 9655.09 7990.1 6918.52 7050.24 6844.2 6520.75 6873.11 7489.61 7459.85 7136.58 6930.38 6401.43 6048.8 5843.01 6224.43 6840.76 7529.23 8452.46 8247.48 8132.72 7632.03 7339.11 6549.2 6165.26 6535.8 5793.52 5621.57 5877.31 5391.98 4792.51 5362.35
"Cash & Equivalents" NA NA 747 132 394 69 1381 769 648 398 492 516 338 198 178 87 260 75 311 651 74 68 1757 144 210 192 186 157 94 234 63 177 81 119 818 477 26 70 487 55 49 49 60 62 117.86 83.4 59.2 108.34 119 818 477 26 70 487 55 49 49 60 62 117.86 83.4 59.2 108.34 271.35 432.14 41.63 59.57 94.83 72.81 37.66 73.6 485.05 188.94 291.14 57.5 102.29 153.82 105.01 198.26 183.46 269.87 12.23 94.9 106.88 117.28 57.37 103.23 342.29 429.89 48.49 111.39 245.22 360.74 80.65 205.1 36.76 203.96 143.32 74.33 282.45 349.66 384.84 238.24 317.86 315.65 291.01 185.21 353.33 160.33 160.31
"Preferred & Other" NA NA 0 0 0 0 0 0 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 257 256 255 255 254 254 254 255 255 255 254 255 255 252 252 253 254 255 221 222 221 221.47 221.13 221.2 220.79 254 255 255 252 252 253 254 255 221 222 221 221.47 221.13 221.2 220.79 222.09 212.56 249.61 212.56 249.61 212.56 212.56 212.56 249.61 212.56 212.56 212.56 249.61 318.02 318.02 318.02 318.02 322.34 322.42 322.54 322.65 322.74 322.77 322.84 639.92 639.98 640.13 640.24 640.31 640.39 640.47 640.54 640.73 640.89 640.95 641.09 641.25 645.87 634.99 635.05 635.18 637.51 637.73 638.05 638.15 640.53 640.77
"Total Debt" NA NA 12379 11982 11309 11111 11873 11073 10675 10676 10678 11144 10683 11526 11020 11027 10599 10773 10366 10699 10094 9751 9480 9363 9282 9213 8653 8943 8815 8968 8487 8162 8205 7687 7868 7498 7219 7245 7336 7432 7094 6968 6682 7000 6841.23 6584.25 6374.14 6264.74 7687 7868 7498 7219 7245 7336 7432 7094 6968 6682 7000 6841.23 6584.25 6374.14 6264.74 6234.03 6249.6 6448.51 6100.6 6011.55 5693.56 5536.13 5276.01 5449.52 4792.08 4881.68 4471.08 4312.4 4410.61 4480.08 4437.33 4758.17 4432.04 4532.28 4466.59 4387.54 4313.86 4316.43 4316.66 4146.02 4175.36 4082.33 4085.09 4089.16 4116.98 3970.11 3972.46 3827.89 3850.12 3927.94 3722.68 3709.36 3804.58 3658.69 3885.52 3667.45 3734.29 3737 3615.16 3492.38 3374.62 3229.81
"Enterprise Value" NA NA 28714.69 29729.8 27181.11 28582.1 28706.39 27414.13 28407.87 27191.24 25991.71 25665.06 25013.42 25226.56 23223.31 23703.1 23323.45 22184.2 20552.48 21124.21 20888.99 21646.74 18607.37 20294.32 22616.42 21834.8 20943.79 22253.51 21350.92 20842.12 19621.65 18929.79 19743.1 19709.9 18731.1 17525.34 18054.99 17594.51 16702.1 17632.68 17013.38 16324.3 16574.33 15408.64 16105.45 15308.35 15430.68 15286 19709.9 18731.1 17525.34 18054.99 17594.51 16702.1 17632.68 17013.38 16324.3 16574.33 15408.64 16105.45 15308.35 15430.68 15286 14751.46 14671.06 15101.34 14121.44 14329.37 13071.51 11990.59 11588.31 12590.55 13864.46 14898.46 14977.66 16770.77 16580.82 15478.67 15566.25 14547.82 12474.62 11760.98 11744.46 11447.51 11040.07 11454.93 12025.88 11903.5 11522.02 11604.35 11015.38 10533.05 10239.65 10754.35 11248.66 11961.09 12739.51 12673.05 12422.15 11700.18 11439.9 10458.04 10447.58 10520.58 9849.67 9705.29 9945.31 9169.17 8647.34 9072.61
"Total Revenue" 2896.75 3461.25 2818 3184 2901 3438 2771 3078 2915 3629 2993 3349 3140 3707 3017 3462 3273 3489 2845 3423 2998 3858 3149 3577 3228 3579 2957 3357 2649 3441 2555 3317 3107 3337 2395 2800 2181 2734 2164 2685 2279 2801 2176 2570 2057.03 2539.49 1848 2056 3337 2395 2800 2181 2734 2164 2685 2279 2801 2176 2570 2057.03 2539.49 1848 2056 1942.6 2627.56 2112.22 2886.26 2250.13 2820.78 2041.89 2318.59 1963.38 2346.24 1479.08 1776.59 1617.34 2061.62 1561.04 1853.05 1720.06 2011.03 1504.01 1886.15 1632.3 1920.34 1539.73 1867.36 1528.38 1879.88 1459.85 1668.79 1461.25 1821.99 1392.09 1697.76 1483.61 1799.69 1396.01 1586.08 1478.81 1717.88 1280.11 1456.11 1342.73 1720.3 1330.65 1479.39 1367.21 1613.83 1263.27
"Growth % YoY" -0.15 0.68 1.7 3.44 -0.48 -5.26 -7.42 -8.09 -7.17 -2.1 -0.8 -3.26 -4.06 6.25 6.05 1.14 9.17 -9.56 -9.65 -4.31 -7.13 7.8 6.49 6.55 21.86 4.01 15.73 1.21 -14.74 3.12 6.68 18.46 42.46 22.06 10.67 4.28 -4.3 -2.39 -0.55 4.47 10.79 10.3 17.75 25 5.89 -3.35 -12.51 -28.77 22.06 10.67 4.28 -4.3 -2.39 -0.55 4.47 10.79 10.3 17.75 25 5.89 -3.35 -12.51 -28.77 -13.67 -6.85 3.44 24.48 14.6 20.23 38.05 30.51 21.4 13.81 -5.25 -4.13 -5.97 2.52 3.79 -1.75 5.38 4.72 -2.32 1.01 6.8 2.15 5.47 11.9 4.59 3.18 4.87 -1.71 -1.51 1.24 -0.28 7.04 0.32 4.76 9.05 8.93 10.13 -0.14 -3.8 -1.57 -1.79 6.6 5.33 -1.02 NA NA NA
"Gross Profit" NA NA 1874 2080 1981 2393 1934 1993 1846 2244 1794 2000 1942 2103 1723 1826 1700 1979 1558 1551 1459 1531 1420 1588 1478 1595 1317 1506 1273 1554 1202 1322 1179 1460 1097 1217 916 1285 980 1169 1066 1349 975 1157 1024.93 1317.57 980 1091 1460 1097 1217 916 1285 980 1169 1066 1349 975 1157 1024.93 1317.57 980 1091 1052.71 1368.8 1091.61 1236.41 991.8 1374.86 1043.29 1236.87 1129.87 1507.31 998.19 1190.69 1151.22 1475.08 1025.84 1170.8 1115.9 1438.56 981.96 1159.37 1094.25 1401.25 1001.2 1198.64 1079.65 1405.45 984.46 1196.22 1086.13 1415.37 998.06 1177.1 1086.53 1381.01 971.41 1118.91 1055.19 1331.37 947.22 1036.88 991.58 1301.1 921.48 994.97 967.89 1217.32 848.39
"Margin %" NA NA 66.5 65.33 68.29 69.6 69.79 64.75 63.33 61.84 59.94 59.72 61.85 56.73 57.11 52.74 51.94 56.72 54.76 45.31 48.67 39.68 45.09 44.39 45.79 44.57 44.54 44.86 48.06 45.16 47.05 39.86 37.95 43.75 45.8 43.46 42 47 45.29 43.54 46.77 48.16 44.81 45.02 49.83 51.88 53.03 53.06 43.75 45.8 43.46 42 47 45.29 43.54 46.77 48.16 44.81 45.02 49.83 51.88 53.03 53.06 54.19 52.09 51.68 42.84 44.08 48.74 51.09 53.35 57.55 64.24 67.49 67.02 71.18 71.55 65.72 63.18 64.88 71.53 65.29 61.47 67.04 72.97 65.02 64.19 70.64 74.76 67.44 71.68 74.33 77.68 71.7 69.33 73.24 76.74 69.58 70.55 71.35 77.5 74 71.21 73.85 75.63 69.25 67.26 70.79 75.43 67.16
"EBITDA" 758 1074 641 777 699 1091 711 794 684 978 617 844 708 916 640 696 625 885 569 611 567 586 520 702 596 715 510 694 547 670 467 564 423 717 411 533 274 624 367 497 458 669 334 485 388.44 693.3 384 487 717 411 533 274 624 367 497 458 669 334 485 388.44 693.3 384 487 445 695.27 439.32 538.75 377.16 666.39 492.65 526.86 446.87 748.34 331.51 492.91 430.87 760.5 313.33 474.78 434.79 751.92 280.96 463.41 390.79 712.97 313.14 490.27 368.26 711.24 307.36 506.85 383.64 721.41 317.3 474.34 363.04 678.27 279.09 400.41 320.03 637.82 281.47 340.21 297.39 610.07 247.48 300.27 305.15 561.67 203.06
"Margin %1" 26.17 31.03 22.75 24.4 24.1 31.73 25.66 25.8 23.46 26.95 20.61 25.2 22.55 24.71 21.21 20.1 19.1 25.37 20 17.85 18.91 15.19 16.51 19.63 18.46 19.98 17.25 20.67 20.65 19.47 18.28 17 13.61 21.49 17.16 19.04 12.56 22.82 16.96 18.51 20.1 23.88 15.35 18.87 18.88 27.3 20.78 23.69 21.49 17.16 19.04 12.56 22.82 16.96 18.51 20.1 23.88 15.35 18.87 18.88 27.3 20.78 23.69 22.91 26.46 20.8 18.67 16.76 23.62 24.13 22.72 22.76 31.9 22.41 27.74 26.64 36.89 20.07 25.62 25.28 37.39 18.68 24.57 23.94 37.13 20.34 26.25 24.09 37.83 21.05 30.37 26.25 39.59 22.79 27.94 24.47 37.69 19.99 25.25 21.64 37.13 21.99 23.36 22.15 35.46 18.6 20.3 22.32 34.8 16.07
"Net Income Before XO" 214.5 410 172 192 207 440 214 280 193 386 168 314 236 353 186 229 205 339 153 183 163 185 283 303 209 313 154 261 205 234 129 183 148 290 121 184 55 253 92 158 50 260 69 157 123.03 286.54 101 169 290 121 184 55 253 92 158 50 260 69 157 123.03 286.54 101 169 128.51 280.74 104.07 182.51 49.48 283.27 72.14 191.53 124.96 339.41 69.8 180.05 135.23 351.55 66.51 176.45 143.61 355.04 47.56 166.61 120.15 327.99 71.42 188.48 113.12 333.3 76.4 201.03 117.88 339.87 87.21 189.31 117.29 324.84 62.45 153.94 100.63 309.44 77.54 116.48 92.2 303.36 64.65 106.7 121.1 263.26 49.06
"Margin %2" 7.4 11.85 6.1 6.03 7.14 12.8 7.72 9.1 6.62 10.64 5.61 9.38 7.52 9.52 6.17 6.61 6.26 9.72 5.38 5.35 5.44 4.8 8.99 8.47 6.47 8.75 5.21 7.77 7.74 6.8 5.05 5.52 4.76 8.69 5.05 6.57 2.52 9.25 4.25 5.88 2.19 9.28 3.17 6.11 5.98 11.28 5.47 8.22 8.69 5.05 6.57 2.52 9.25 4.25 5.88 2.19 9.28 3.17 6.11 5.98 11.28 5.47 8.22 6.62 10.68 4.93 6.32 2.2 10.04 3.53 8.26 6.36 14.47 4.72 10.13 8.36 17.05 4.26 9.52 8.35 17.65 3.16 8.83 7.36 17.08 4.64 10.09 7.4 17.73 5.23 12.05 8.07 18.65 6.26 11.15 7.91 18.05 4.47 9.71 6.8 18.01 6.06 8 6.87 17.63 4.86 7.21 8.86 16.31 3.88
"Adjusted EPS" 0.7 1.42 0.59 1.07 0.69 1.44 0.61 1.01 0.74 1.33 0.57 0.99 0.69 1.32 0.51 0.93 0.67 1.16 0.48 0.78 0.72 0.98 0.42 0.87 0.71 1.2 0.58 1.03 0.78 0.92 0.51 0.86 0.59 1.17 0.48 0.75 0.49 1.08 0.38 0.69 0.65 1.16 0.29 0.72 0.56 1.33 0.46 0.78 1.17 0.48 0.75 0.49 1.08 0.38 0.69 0.65 1.16 0.29 0.72 0.56 1.33 0.46 0.78 0.59 1.3 0.48 0.84 0.52 1.4 0.33 0.88 0.57 1.5 0.3 0.76 0.56 1.49 0.26 0.73 0.59 1.49 0.18 0.69 0.49 1.38 0.28 0.78 0.44 1.38 0.29 0.82 0.47 1.41 0.33 0.77 0.46 1.35 0.23 0.62 0.39 1.3 0.3 0.47 0.36 1.29 0.24 0.43 0.49 1.11 0.18
"Growth % YoY1" 0.72 -1.67 -3.28 5.94 -6.76 8.27 7.02 2.02 7.25 0.76 11.76 6.45 2.99 13.79 6.25 19.23 -6.94 18.37 14.29 -10.34 1.41 -18.33 -27.59 -15.53 -8.97 30.43 13.73 19.77 32.2 -21.37 6.25 14.67 20.41 8.33 26.32 8.7 -24.62 -6.9 31.03 -4.17 16.07 -12.78 -36.96 -7.69 -5.08 2.31 -4.17 -7.14 8.33 26.32 8.7 -24.62 -6.9 31.03 -4.17 16.07 -12.78 -36.96 -7.69 -5.08 2.31 -4.17 -7.14 13.46 -7.14 45.45 -4.55 -8.77 -6.67 10 15.79 1.79 0.67 13.64 4.11 -5.08 -0.07 44.44 5.89 20.41 8.05 -34.72 -11.62 11.36 0 -3.45 -4.88 -6.38 -2.13 -12.12 6.49 2.17 4.44 43.48 24.19 17.95 3.85 -23.33 31.91 8.33 0.78 25 9.3 -26.53 16.22 33.33 -23.21 NA NA NA
"Cash from Operations" 375.79 812.21 991 -84 961 391 845 402 976 572 1227 362 1407 179 794 1 997 26 798 645 581 -1237 733 563 630 109 346 481 710 -162 224 593 177 581 -346 389 525 164 490 152 766 218 492 -58 735.49 285 369 146 581 -346 389 525 164 490 152 766 218 492 -58 735.49 285 369 146 490.18 387.73 254.59 141.41 215.82 279.84 489.5 199.17 -325.31 -66.66 280.22 256.65 718.82 438.66 302.05 244.37 -52.38 647.78 53.19 258.9 294.29 359.1 267.8 184.51 310.07 585.52 233.75 145.31 426.63 480.57 187.86 270.34 236.08 472.92 243.13 69.8 261.19 291.41 285.57 77.33 283.64 328.4 309.68 11.95 357.21 141.59 357.15
"Capital Expenditures" NA NA -660 -676 -608 -478 -635 -523 -542 -503 -629 -460 -599 -548 -551 -465 -719 -531 -595 -529 -785 -584 -608 -547 -638 -519 -485 -482 -583 -480 -537 -420 -619 -385 -426 -390 -431 -439 -308 -373 -448 -356 -404 -317 -593.69 -310 -392 -340 -385 -426 -390 -431 -439 -308 -373 -448 -356 -404 -317 -593.69 -310 -392 -340 -302.22 -394.08 -274.8 -228.02 -75.57 -274.36 -684.94 -207.41 -211.95 -218.98 -157.07 -127.56 -210.59 -156.81 -150.58 -127.3 -226.32 -145.55 -171.37 -140.37 -244.12 -167.92 -185.35 -142.94 -239.55 -165.98 -166.25 -147.38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
"Free Cash Flow" NA NA 331 -760 353 -87 210 -121 434 69 598 -98 808 -369 243 -464 278 -505 203 116 -204 -1821 125 16 -8 -410 -139 -1 127 -642 -313 173 -442 196 -772 -1 94 -275 182 -221 318 -138 88 -375 141.79 -25 -23 -194 196 -772 -1 94 -275 182 -221 318 -138 88 -375 141.79 -25 -23 -194 187.96 -6.35 -20.21 -86.61 140.26 5.47 -195.45 -8.24 -537.26 -285.64 123.15 129.09 508.23 281.85 151.46 117.07 -278.7 502.23 -118.18 118.53 50.17 191.18 82.45 41.57 70.51 419.54 67.49 -2.08 426.63 480.57 187.86 270.34 236.08 472.92 243.13 69.8 261.19 291.41 285.57 77.33 283.64 328.4 309.68 11.95 357.21 141.59 357.15
"Adjusted Price" 2094.66 3689.2 3805.62 3588.42 3582.4 3885.75 3523.13 3554.9 3420.27 3141.36 2984.19 2838.81 2760.09 2517.44 2447.56 2403.89 2188.98 1960.8 1952.2 2033.87 2099.97 1993.98 2043.36 2296.42 2201.73 2277.15 2301.5 2203.47 2086.87 1938.95 2019.34 2002.47 2048.12 1881.97 1817.17 1807.02 1664.57 1659.78 1717.25 1585.27 1589.9 1506.13 1534.98 1531.24 1498.21 1528.96 1418.46 1431.1 1343.43 1244.04 1194.62 1076.93 1058.66 960.76 1112.69 1322.69 1414.59 1442.28 1545.6 1364.27 1305.46 1231.15 1022.23 869.37 796.9 820.22 762.84 715.9 756.11 816.37 731.97 705.73 657.84 628.55 571.47 624.67 651.89 676.63 759.77 742.27 734.39 657.44 619.61 569.84 524.2 510.26 475.43 449.8 441.27 409.34 383 413.34 441.72 435.71 419.07 385.87 356.85 346.15 326.97 318.45 323.72 314.18 313.22 300.88 329.3 315.1 312.34 279.11 163.47 NA
The larger chunk works perfectly, but I need to be able to check the correlation on the smaller sections. I'm really new to R so it might be easy, but I've read the boards here and the r manuals and can't find it.
In your example above, your code fails on the first (smaller) data set because row 3 consists only of 0's and NA's, so it has a standard deviation of 0 and so its correlation with any other row will return NA, since computing correlation involves dividing the sample covariance by the sample standard deviation of each vector. It doesn't happen in the larget example because row 3 has sufficient variation to have a non-zero standard deviation.
However, your approach seems a bit convoluted. If you want to compute the correlation between a single row in the matrix and all other rows, sorted by correlation, then you can use cor() on the transposed matrix and sort the result, for example:
mycor <- function(dataset, relative.to=19) {
mat <- t(dataset)
cors <- cor(mat, mat[, relative.to], use="na.or.complete")
cors[order(drop(cors)), ]
}
mycor(dataset)
Had anyone else had this problem, or even better, does anyone know why this is giving me an error?
I'm attempting to create an ARMA model of order 3, 3. I'm using the TSA package.
stocks_arma <- arma(stocks$close, order = c(3,3))
I'm getting this warning:
Warning message:
In arma(VIXts, order = c(3, 3)) : Hessian negative-semidefinite
I understand that a Hessian negative-semidefinite matrix is a bad thing because we usually want global mins/maxes. However, I don't understand why this is happening. I am unsure is this is a mathematical issue or a syntactial issue.
My data is a very modest vector of 1000 entries. Here is one-tenth of it:
15.14 15.31 15.08 15.24 16.41 17.99 17.92 16.65 16.68 18.61 18.49 19.08 17.58 18.42 17.59 16.69 18.60 17.81 18.12 18.33 18.83 16.62 16.97 15.03 15.07 15.22 15.27 16.14 15.59 16.29 16.37 15.11 14.33 14.55 15.43 15.71 16.32 15.73 14.84 16.81 15.43 14.15 13.98 14.07 13.88 14.18 14.59 14.51 14.05 15.80 16.41 16.28 14.38 15.63 17.74 17.98 17.47 17.83 17.06 16.49 16.35 15.18 15.96 15.11 15.02 14.02 13.45 14.29 14.63 14.85 13.70 14.74 15.28 15.32 15.99 15.95 15.64 17.57 18.96 18.93 18.03 16.70 17.53 19.34 20.47 18.62 16.27 15.45 16.16 16.48 17.11 16.74 18.36 17.95 18.72 18.05 17.10 17.50 16.66 16.80 17.08 19.71 19.45 19.72 20.38
There is nothing overtly fishy about the values at all.
Any insight is very much appreciated.