Displaying 20 results from an estimated 9000 matches similar to: "external variable by inside-function routines modifications"
2016 Sep 29
3
Web site for MacOSX R-devel precompiled version
From several years, I used this site http://r.research.att.com to get a
precompiled version of macosx R-devol but the most recent version is
frozen at the 18/8 build (r 71112).
Is there an alternative (except than compile myself !) ?
Thanks,
Marc
2009 Jan 09
5
The R Inferno
"The R Inferno" is now on the Burns Statistics website at
http://www.burns-stat.com/pages/Tutor/R_inferno.pdf
Abstract: If you are using R and you think you're in hell,
this is a map for you.
Also, I've expanded the outline concerning R on the
Burns Statistics 'Links' page. Suggestions (off-list) for
additional items are encouraged.
Patrick Burns
patrick at
2010 Dec 23
1
speed issues? read R_inferno by Patrick Burns: & a memory query
Hi,
I'm just starting out with R and came across R_inferno.pdf by Patrick Burns
just yesterday - I recommend it!
His description of how 'growing' objects (e.g. obj <- c(obj,
additionalValue) eats up memory prompted me to rewrite a function (which
made such calls ~210 times) so that it used indexing into a dimensioned
object instead (i.e. obj[i, ] <- additionalValue).
This
2012 Jul 17
3
complexity of operations in R
Hello!
I am optimizing my code in R and for this I need to know a bit more about
the internals. It would help tremendously if someone could link me to a
page with O()-complexities of all the operations.
In this particular case, I need something like a linked list with O(1)
insertLast/First ability. I can't preallocate a vector since I do not know
the final size of the list ahead of time.
The
2011 Jul 19
1
dead code removal
Hi there,
I have some unused code in my project but have no idea how to clean
it up in some kind of automatic way.
Maybe there are some tools/ways to identify and remove/mark dead
parts of the code?
Thanks in advance!
Kind regards,
Alex
2009 Oct 02
1
xts dates spacings
Hello!
Please help - can't find any options how to remove very big spaces between
two dates containing intraday prices plotted by plot.xts. It looks like the
following: on the left side of the plot window is the first bunch of points,
the same is for the right hand side and a long line connecting them in the
middle. I would want to merge them (cut spaces) somehow.
In any case thanks for
2010 Dec 07
2
tableGrob and properties of a cell
Hello there,
could you please help to modify gpar() properties of a cell inside
tableGrob() output.
In the following example I want to have different color for one out of 4 cells
require(gridExtra)
z<-matrix(1:4,2,2)
grid.draw(tableGrob(z))
The only way I found for now how to do it is to do something like this
downViewport(current.vpTree()$children[[1]]$children[[6]]$name)
2011 Sep 20
2
Is it possible to pass a function argument from R to compiled code in C?
I have a function in R that takes another function as argument:
f <- function(g, ...) { #g is expected to be a function
}
I want to see if there is a way to implement "f" in C and calling it from R
using ".C" interface. I know that I can use function pointers for my C
implementation, but I imagine it's going to be nearly impossible to pass a
function from R to C. Are
2012 Nov 22
1
Optimizing nested function with nlminb()
I am trying to optimize custom likelyhood with nlminb()
Arguments h and f are meant to be fixed.
example.R:
compute.hyper.log.likelyhood <- function(a, h, f) {
a1 <- a[1]
a2 <- a[2]
l <- 0.0
for (j in 1:length(f)) {
l <- l + lbeta(a1 + f[j], a2 + h - f[j]) - lbeta(a1, a2)
}
return(l)
}
compute.optimal.hyper.params <- function(start, limits, h_, f_) {
result
2011 Nov 11
3
Why does length("") == 1?
It seems obvious to me that the empty string "" is length 0.
cheers
Worik
[[alternative HTML version deleted]]
2014 Aug 06
2
Subscripting Matrices
There seems to be a result type difference when subscripting a 6 x 1
matrix as compared to a 3 x 2 matrix that is caused by the ncol = 1
compared to ncol > 1.
> ThinMatrix <- matrix(1:6,ncol=1)
> ThinMatrix
[,1]
[1,] 1
[2,] 2
[3,] 3
[4,] 4
[5,] 5
[6,] 6
> FatMatrix <- matrix(1:6,ncol=2)
> FatMatrix
[,1] [,2]
[1,] 1 4
[2,] 2 5
2009 Sep 17
2
r-inferno.pdf with detailed table of contents and bookmarks
Hi,
I don't find a r-inferno.pdf that has detailed table of contents and
bookmarks. If it is possible, can somebody help generated one and post
it on line?
Regards,
Peng
2010 Dec 01
1
Difference between loops and vectorization
Hello R-helpers,
A fundamental question ...I'm trying to understand the differences
between loop and vectorization ... I understand that it should be a
natural choice to use apply / adply when it is needed to perform the
same function across all rows of a data frame.
Any pointers on why this is so? Unable to find the right reading place
on the WWW which explains the concept.
Thanks for your
2012 Jan 22
2
if/else statement without curly brackets gives a problem
Hello,
This example seems strange to me:
> if (2 > 3) print('Yes'); else print('No')
Error: unexpected 'else' in " else"
> {if (2 > 3) print('Yes'); else print('No')}
Error: unexpected 'else' in "{if (2 > 3) print('Yes'); else"
> {
+ if (2 > 3) print('no')
+ else print('yes')
+ }
2012 Jan 26
2
What does [[1]] mean?
I know that [] is used for indexing.
I know that [[]] is used for reference to a property of a COM object.
I cannot find any explanation of what [[1]] does or, more pertinently, where it should be used.
Thank you.
[[alternative HTML version deleted]]
2012 Mar 03
1
"Global" Variable in R
Dear all, I would like to ask you if there is a way
to define a global variable in R?
I am having a bunch of function and I think the easier would be to have a global function defined at some point...
Would that be possible?
Regards
Alex
[[alternative HTML version deleted]]
2009 Mar 18
3
numeric equality
Dear all,
I am totally confused by the following R output, but don't have a clue
for it.
> a <- 1 - 0.2
> a == 0.8
[1] TRUE
> a <- 1 - 0.8
> a == 0.2
[1] FALSE
> a <- 1 - 0.5
> a == 0.5
[1] TRUE
> a <- 1 - 0.6
> a == 0.4
[1] TRUE
> a <- 1 - 0.9
> a == 0.1
[1] FALSE
My R version is Windows XP R version 2.8.1 (2008-12-22).
2011 Apr 14
2
appending to a vector
Which one is more efficient?
x2=c()
for (i in 1:length(x)) {
x2=c(x2,func(x[i]))
}
or
x2=x
for (i in 1:length(x)) {
x2=func(x[i])
}
where func is any function?
Dirk
--
View this message in context: http://r.789695.n4.nabble.com/appending-to-a-vector-tp3449109p3449109.html
Sent from the R help mailing list archive at Nabble.com.
2012 Jun 30
2
incorrect number of subscripts on matrix
Hi,
Wondering if anyone could help me out with this error.Im trying to fill a matrix with random numbers taken from an exponential distribution using a loop:
x.3<-matrix(rep(0,3000),nrow=1000,byrow=T)for(i in 1:1000){x[i,]<-rexp(3,rate=2/3)}
I get the error message:
Error in x[i, ] <- rexp(3, rate = 2/3) : incorrect number of subscripts on matrix
Any ideas??? Appreciate any thoughts.
2011 Feb 16
1
incomplete final line
Hi,
I work like this:
> data<?read.table('E:/my documents/r/consumer.xls',header=TRUE)
Warning message:
In read.table("E:/my documents/r/consumer.xls", header = TRUE) :
incomplete final line found by readTableHeader on 'E:/my
documents/r/consumer.xls'
could someone shoot the trouble for me ? thx
sorry for trouble ,im a newbie.
--
View this message in