Piece of R code with Error that Moves... !

Status
Not open for further replies.

abrogard

Distinguished
Oct 29, 2009
102
0
18,690
I have this little bit of R code. And I keep getting an error message: "unexpected symbol in...."

I wrote another line under it to see what would happen and the error moved down to that line!

It then told me the error was in that line - while mentioning nothing about the previous error.

That means the interpreter has passed the first line as okay. Doesn't it?

So I delete all of that thinking maybe there's a hidden char or something.

Then I write it in again. And the error comes back. It won't accept the line.

Can anyone help?

this is the code - it's full of test prints...


for(z in 1:20){
startval <- Int[z]
for ( i in 1:24) {
cat("startval")
cat(startval)
cat("Int)
cat(Int)
diff - Int - startval **** this is the line it flags as in error.
cat("diff")
print(diff)
addup <- addup + diff
cat("addup")
print(addup)
}
cat("Int")
cat(i)
print(addup)

}



 

abrogard

Distinguished
Oct 29, 2009
102
0
18,690
Really? In various languages I'd suppose? What would you say would be a good, quick and (relatively) easy language for general use today?

For today's platforms.

I would have said Basic. But now I find win10 has trouble running Basic. I couldn't find one that would run. Except MS 'Visual' Basic as they call it in Visual Studio. But that's what I mean about 'quick'. I don't see it as quick and readily available to have to boot up vis studio before you can start.

R has the requirements in that respect - but I'm finding a bit of a learning curve with vector arithmetic et al.

I talk too much. That's what I should have said: 'What would you recommend as better than R for those who don't really need all of R's specialist tools?'

Anything?
 
Status
Not open for further replies.