search for: bluesky315

Displaying 19 results from an estimated 19 matches for "bluesky315".

2010 Feb 10
3
What is the difference between typeof and storage.mode?
S Programming by Venables and Ripley (2000) says on page 8, "R objects have another way to give information using the function \tttext{typeof}, which often gives the same information as \tttext{storage.mode}." It implies that there are some differences between typeof and storage.mode. However, according to ?typeof and ?storage.mode, it doesn't seem to be so. Could somebody let me
2010 Feb 09
2
Model matrix using dummy regressors or deviation regressors
The model matrix for the code at the end the email is shown below. Since the model matrix doesn't have -1, I think that it is made of dummy regressors rather than deviation regressors. I'm wondering how to make a model matrix using deviation regressors. Could somebody let me know? > model.matrix(aaov) (Intercept) A2 B2 B3 A2:B2 A2:B3 1 1 0 0 0 0 0 2
2010 Feb 08
3
What is the equivalent function in R to xyplot in S?
Page 140 of MASS uses the function xyplot. But I don't find it in R. Is there a package that I should load to use xyplot. Or there is a function with a different name in R that does the same thing as xyplot in S. xyplot(Gas ~ Temp | Insul, whiteside, panel = function(x, y, ...) { panel.xyplot(x, y, ...) panel.lmline(x, y, ...) }, xlab = "Average external temperature (deg. C)", ylab
2010 Feb 08
2
How to reverse the axis direction in log plot?
The following command gives me a plot where the axes are in log scale but 'x' increases in the right direction. plot(1:10,1:10, log='xy') I want to change the plot such that it is still in log scale but 'x' decreases rather increases in the right direction. I'm wondering if there is an option to do so.
2010 Feb 09
1
The default argument 'envir' of eval()
In ?eval, it says ? ? ... ?If ?envir? is not ? ? specified, then the default is ?parent.frame()? (the environment ? ? where the call to ?eval? was made). I tried the following example with "eval(expr)" ?and "eval(expr, parent.frame())" in f(). The results are different, which are not consistent with the help. Could somebody let know whether I misunderstand the help? Or there
2010 Feb 14
1
NextMethod() example from S Programming by Venables and Ripley (page 78)
S Programming by Venables and Ripley (page 78) has the example listed at the end of this email. However, I get the following error when I try the example. I don't understand the descriptions of NextMethod on its help page. Could somebody let me know how to fix the error of this example? > test(x) c1 c2 Error in NextMethod() : no method to invoke Calls: test -> test.c1 -> NextMethod
2010 Feb 15
1
Which method is called in command like "class(x)='something'"?
> x=3 > `class<-`(x,'something')#this command prints [1] 3 attr(,"class") [1] "something" > x=3 > class(x)='something'#this command doesn't print anything The first of the above two commands print the content of 'x' but the second doesn't, although both of them set the argument 'x'. I'm wondering which is method is
2010 Feb 12
1
filenames with special characters in the R/ directory of a package?
According to R-exts.pdf (page 3): For maximal portability filenames should only contain only ASCII characters not excluded already (that is A-Za-z0-9._!#$%&+,;=@^(){}?[] I have some files with special characters like '[' and '%' e.g. '[.set.R'. I also have some functions that also have those special characters defined in those files exported in NAMESPACE. I use the
2010 Feb 11
3
How to use a string to refer a function?
> f=function(){ print('in f')} > attr(f, 'source') [1] "function(){ print('in f')}" I have the above simple function. I can use the variable f to refer to the function and get the function source. Suppose that I have 'f' as a string (say I get it from ls()), could somebody let me know how to get the function from the name 'f'?
2010 Feb 12
1
Why double quote is preferred?
?'`' shows the following: "Single and double quotes delimit character constants. They can be used interchangeably but double quotes are *preferred* (and character constants are printed using double quotes), so single quotes are normally only used to delimit character constants containing double quotes." It is not clear to me why double quote is preferred (I don't think that
2010 Feb 09
1
"1 observation deleted due to missingness" from summary() on the result of aov()
I have the R code at the end. The last command gives me "1 observation deleted due to missingness". I don't understand what this error message. Could somebody help me understand it and how to fix the problem? > summary(afit) Df Sum Sq Mean Sq F value Pr(>F) A 2 0.328 0.16382 0.1899 0.82727 B 3 2.882 0.96057 1.1136 0.34644 C
2010 Mar 05
1
About the interaction A:B
Suppose, 'fr' is data.frame with columns 'Y', 'A' and 'B'. 'A' has levels 'Aa' 'Ab' and 'Ac', and 'B' has levels 'Ba', 'Bb', 'Bc' and 'Bd'. 'Y' columns are numbers. I tried the following three sets of commands. I understand that A*B is equivalent to A+B+A:B. However, A:B in A+B+A:B is
2010 Mar 05
4
Nonparametric generalization of ANOVA
My interpretation of the relation between 1-way ANOVA and Wilcoxon's test (wilcox.test() in R) is the following. 1-way ANOVA is to test if two or multiple distributions are the same, assuming all the distributions are normal and have equal variances. Wilcoxon's test is to test two distributions are the same without assuming what their distributions are. In this sense, I'm wondering
2010 Feb 09
1
Interpretation of high order interaction terms.
I have difficulties in interpreting high order interaction terms in high-way ANOVA. According to Introductory Statistics with R by Peter Dalgaard (Section 12.5), "The exact definition of the interaction terms and the interpretation of their associated regression coefficients can be elusive. Some peculiar things happen if an interaction term is present but one or more of the main effects are
2010 Feb 25
1
binding multidimension array
I don't find rbind, cbind or other bind that bind in other dimesions for multidimension array while keeping the result of the same dimension. For example, say, dim(x)=c(2,3,4), dim(y)=c(3,3,4). I want to have the result z, where dim(z)=c(2+3,3,4), when I bind x and y in the first dimenion. The bind can also be in the 2nd and 3rd dimesion. Could somebody let me know if this family of
2010 Feb 14
1
How S3method() is implemented and called? And when to use it?
R-exts.pdf discribes S3method a little bit. But I want to understand more on how it is called, implemented and when to use it. I don't find it in an R session. But I see S3method() in some NAMESPACE files. > S3method Error: object 'S3method' not found > ?S3method No documentation for 'S3method' in specified packages and libraries: you could try '??S3method' I
2010 Feb 12
2
How to source files from a search path?
Suppose some environment variable (say MY_R_INC) has a number of paths. I want to source some file relative to some path in $MY_R_INC (just as #include in C++ does, which looks for header file in a number of directories). I RSiteSearch'ed, but I don't find any function that satisfies my need. Could somebody let me know if I overlooked something?
2010 Feb 19
2
What is the difference between expression and quote when used with eval()?
I made the following example to see what are the difference between expression and quote. But I don't see any difference when they are used with eval()? Could somebody let me know what the difference is between expression and quote? expr=expression(2*3) quo=quote(2*3) eval(expr) str(expr) class(expr) typeof(expr) mode(expr) attributes(expr) eval(quo) str(quo) class(quo) typeof(quo)
2010 Feb 12
4
How to get the source code for the assignment of a variable?
'get' can give me the source code for a function. Is there a way to get the source code for a variable? In the following example, the source code for x is 'y*y'. Is there a way to get it using the string 'x'? > f=function(){print('xx')} > get('f') function(){print('xx')} > y=3 > x=y*y > get('x') [1] 9