I'm BRAND NEW to all coding so "like you're explaining it to an 8 year old" answers please!
I have created a function that trails off the right side of my typing area (top left box in RStudio).
MySamplingDistribution <- function(myVector)
{
return(mean(replicate(100, mean(sample(myVector, size=20, replace=TRUE)), simplify=TRUE)))
}
It runs fine in that format, but when I try to break it up on to 2 lines, like my book tells me:
MySamplingDistribution <- function(myVector)
{
return(mean(replicate(100, mean(sample(myVector,+
size=20, replace=TRUE)), simplify=TRUE)))
}
I get this error:
Error: unexpected '}' in "}"
I'm sure it's just some issue with spaces or tabs or something but I've attempted enough combinations and browsed enough forums to be asking here. I've just installed and am using RStudio, if that makes a difference.
THX!