Displaying 20 results from an estimated 80000 matches similar to: "Calling "compiled" functions"
2009 Nov 06
2
Debugging makefiles.
I have sucessfully built and run R from source and I have begun to change some of the source files to help with my learning process. All of a sudden I recieved the following error on build:
building package 'stats'
all.R is unchanged
building package 'datasets'
all.R is unchanged
../../../library/datasets/R/datasets is unchanged
building package 'methods'
all.R is
2009 Jan 03
5
Power functions?
I had a question about the basic power functions in R.
For example from the R console I enter:
-1 ^ 2
[1] -1
but also
-1^3
[1] -1
-0.1^2
[1] -0.01
Normally pow(-1, 2) return either -Infinity or NaN. Has R taken over the math functions? If so I would think that -1^2 is 1 not -1 and -0.1^2 is 0.01 not -0.01.
Thank you.
Kevin
2009 Feb 04
1
Foreign function call
Let me get more specific. I think it this can be answered then I can translate the information to other calls. In the arima 'R' code there is a reference to
.Call(R_TSconv, a, b)
If from the console I type:
> .Call(R_TSConv, c(1,-1), c(1,-1))
I get:
Error: object "R_TSConv" not found
If I do
> getNativeSymbolInfo("R_TSConv")
I get:
Error in
2009 Mar 05
1
hatvalues?
I am struiggling a bit with this function 'hatvalues'. I would like a little more undrestanding than taking the black-box and using the values. I looked at the Fortran source and it is quite opaque to me. So I am asking for some help in understanding the theory. First, I take the simplest case of a single variant. For this I turn o John Fox's book, "Applied Regression Analysis
2011 Oct 22
7
"Plotting" text?
I noticed that the text() command adds text to a plot. Is there a way to
either make the plot blank or add text to a "blank sheet". I would like
to "plot" a page that contains just text, no plot lines, labels, etc.
Suggestions?
Kevin
[[alternative HTML version deleted]]
2010 Mar 22
2
Factors attribute?
I noticed that when I fit a linear model using 'lm' there is an attribute called "factors" that is added to the "term". It doesn't seem to appear for 'model.matrix', just 'lm'. I have been unable to find where it gets constructed or what it means? It looks like a two dimensional array that I may be able to use so I would just like to get some
2008 Oct 10
2
Leap year?
Given a Date object or simply a year is there an R function to tell me if the it is a leap year or not? I was hoping for something like 'is.leapyear'. I probably can build my own function (year divisible by 4 etc.) but I would rather use an existing function if it is available.
Thank you.
Kevin
2008 Aug 28
6
Function not returning a vector?
Why does:
(shape/scale) * (1:365/scale)^(shape - 1)
return a vector of numbers but calling a function
hasard(1:365,shape,scale)
defined like:
hazard <- function(x,shape,scale)
{
return (shape/scale) * (x/scale)^(shape - 1)
}
Only return a single value? It is like x becomes a single value passed as an argument.
Thank you.
Kevin
2011 Nov 07
3
Upgrade R?
I am trying to upgrade to R 2.14 from R 2.13.1 I have compied all the
libraries from the 'library' directory in my existing installation (2.13.1)
to the installed R 2.14. Now I want to uninstall the old installation (R
2.13.1) and I get the error:
Internal Error: Cannot find utCompiledCode record for this version of the
uninstaller.
Any ideas?
Kevin
[[alternative HTML
2008 Sep 01
2
Help with stl
I just realized after some tips and a little digging that what I was trying to do "manually" has already been done. I was trying to fit my data using 'lm' then taking the "residual" data and trying to do a spectral estimate (for seasonality) usiing fft and then passing the "residual" of all of that to arima to get the irregular portion of the time series
2009 Oct 28
5
PDF Corrupted?
I am running R 2.9.2 and creating a PDF that I am trying to open with Adobe Reader 9.2 but when I try to open it the reader responds with
"There was an error opening this document. The file is damaged and cannot be repaired.:
I am using the R command(s):
pdf(file="cat.pdf", title="Historical Sales By Category")
for(j in 1:length(master))
{
d <-
2008 Jul 15
4
Iterations
I have a command that reads in some data:
x <- read.csv("Sales2007.dat", header=TRUE)
Then I try to organize the data:
sc <- split(x, list(x$Category, x$SubCategory), drop=TRUE)
Then I want to iterate through the data. I was able to get the following to run on the R console:
for(i in 1:length(sc))
{
sum(sc[[i]]$Quantity)
}
But notiing is primted on the console. I find
2001 Jul 13
7
too many arguments in foreign function call
Hi all,
I've just been working with a piece of fortran code (Leo Breiman's
random forest code) that needs a lot of arguments. When I use .Fortran,
I get the message 'too many arguments in foreign function call'.
Neither the help page for .Fortran (actually Foreign) nor "Writing R
Extensions" explains how many arguments are too many.
Looking at the code in
2001 Jul 13
7
too many arguments in foreign function call
Hi all,
I've just been working with a piece of fortran code (Leo Breiman's
random forest code) that needs a lot of arguments. When I use .Fortran,
I get the message 'too many arguments in foreign function call'.
Neither the help page for .Fortran (actually Foreign) nor "Writing R
Extensions" explains how many arguments are too many.
Looking at the code in
2008 Oct 07
4
sort a list?
I am trying to sort a list and the data is obiously not in the right format. I am trying:
x <- list()
x[["A"]] <- 1
x[["B"]] <- 2
order(x)
But am getting:
Error in order(x) : unimplemented type 'list' in 'orderVector1'
How should I change the list so that it can be sorted? What kinds of objects (classes of objects) can be sorted?
Thank you.
Kevin
2009 Aug 03
3
if confusion
Simple question:
Why doesn't the following work? Or what 'R' rule am I missing?
tclass <- "Testing 1 2 3"
if(tclass == "Testing 1 2 3")
{
cat("Testing", tclass, "\n")
}
else
{
cat(tclass, "\n")
}
I get an error 'else' is unexpected.
Thank you.
Kevin
2008 Aug 03
2
Determining model parameters
This may be a begining question. If so, please bear with me.
If I have some data that based on the historgram and other plots it "looks" like a beta distribution. Is there a function or functions within R to help me determine the model parameters for such a distirbution? Similarily for other "common" distirbutions, Poisson(lambda), Chi-Square(degrees of freedom, chi-square
2010 Mar 06
1
Interpretation of 'swtich'
In browsing the source I see the following construct:
res <- switch(type, working = , response = r, deviance = ,
pearson = if (is.null(object$weights))
r
else r * sqrt(object$weights), partial = r)
I understand that 'switch' will execute the code that is matched by its corresponding string value (in this case 'type'). What I don't
2011 Nov 08
3
window?
Can someone enlighten me on why the following doesn't work?
setwd('C:/Temp/R')
d <- rep(1:53,2)
(s <- ts(d, frequency=53, start=c(2000,10)))
n <- length(s)
k <- n%/%3
for(i in (n-k):n)
{
st <- c(start(s)[1] + (start(s)[2] + i)%/%frequency(s), (start(s)[2] +
i) %% frequency(s))
ed <- c(start(s)[1] +
2009 Mar 17
2
sweep?
I am having a hard time understanding just what 'sweep' does. The documentation states:
Return an array obtained from an input array by sweeping out a summary statistic.
So what does it mean "weeping out a summary statistic"?
Thank you.
Kevin