[R] Why Does R Print out strange record?

arthur brogard abrogard at yahoo.com
Tue Dec 20 02:08:33 CET 2016


I have this bit of code:
rates=read.csv("Rates2.csv")
attach(rates)
mysize <- nrow(rates)
count <- 0
for(i in 1:(mysize - 3)) {
#print(i)
thisday <- Date[i]
thisone <- Int[i+1] - Int[i]
nextone <- Int[i+2] - Int[i]
lastone <- thisone + nextone
lastone <- lastone/6.5
lastone <- lastone * 1000

#print("thisone")
#print(thisone)
#print("nextone")
#print(nextone)

if (lastone >0){
print(thisday)
print("dollars saved per $100,000")
print(lastone)
count = count + 1
}
}
which generally works alright until I put the last bit in about 'thisday'
since then I get a display with such as this in it:
[1] "dollars saved per $100,000"
[1] 9.230769
[1] Feb-2012
689 Levels: Apr-1959 Apr-1960 Apr-1961 Apr-1962 ... Sep-2015
[1] "dollars saved per $100,000"
[1] 18.46154
[1] Jun-2015
689 Levels: Apr-1959 Apr-1960 Apr-1961 Apr-1962 ... Sep-2015
[1] "dollars saved per $100,000"
[1] 21.53846

This word 'Levels'  is not present in the data.  

Can anyone help, tell me what is happening here?


 ================================

Can you handle truth ? 

Barbara Walker: Woman's Encyclopedia of Myths and Secrets

What it is really about:
https://www.youtube.com/watch?v=sYKAgAfYJZE

The bald truth:
https://www.youtube.com/watch?v=kevNDOCbKxE

https://www.youtube.com/watch?v=fbfdsMdbcfA

Sanity:
Those terrible Russians:
https://www.youtube.com/watch?v=VZsjoiFfpXM
	[[alternative HTML version deleted]]



More information about the R-help mailing list