[R] Strange results from Windows 7
Joshua Wiley
jwiley.psych at gmail.com
Sun Jan 17 21:02:14 CET 2010
Hello Alan,
Following up on Gabor's suggestion, if you have different packages
loaded, one of those packages could have a function 'diff' that would
not show up with a call to ls() so you could also try
search()
which will show you what packages are loaded.
HTH,
Joshua
On Sun, Jan 17, 2010 at 1:40 AM, Tse Ching Biu, Alan (MKT)
<alan at baf.msmail.cuhk.edu.hk> wrote:
> Hello,
>
> I am a newbie.
>
> I can run the following code stored in "test.txt" without error using my
> XP machine:
>
> x <- scan("C:\\Rwork\\A.txt")
> x10 = filter(x, rep(1/10,10), sides=1)
> x
> x10
> for(i in 10:length(x)){
> if (x[i] > x10[i]) diff[i]="b" else diff[i]="s"
> }
>
> However, if I run it in another PC that uses Windows 7, the following
> error occurs:
>
>> source("c:\\Rwork\\test.txt")
> Read 290 items
> Error in diff[i] = "b" : object of type 'closure' is not subsettable
>
> I am using R 2.9.2.
>
> Thank you for your help.
>
> Alan
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Joshua Wiley
Senior in Psychology
University of California, Riverside
http://www.joshuawiley.com/
More information about the R-help
mailing list