Displaying 20 results from an estimated 2000 matches similar to: "Two dimensional Array defined on intevals"
2010 Dec 07
3
More elegant magnitude method
I have a need to find the order of number to get a scaling parameter as a
power of 10. I have a function that works *so far*, but it is ugly and
probably buggy. In the interest of avoiding code-based outliers in my
data, I thought I would ask if anyone here has a better way.
> scl <- function(x){
+ length(charToRaw(format(trunc(x), scientific = F)))-1}
> a <- 123456789
> b <-
2010 Nov 01
1
Possible memory leak in loop.
I was trying to use memory.size() to determine whether a code loop I am
executing created a memory leak, since one replicate of the simulation
takes 670.98 seconds according to proc.time(), while 5 replicates takes
170762 seconds. So I set it up as:
memA <- memory.size()
looping code...
memB <- memory.size()
memA returns as 9.3, and memB returns 11.3. I'm not familiar with
2011 Mar 15
1
(no subject)
I was wondering if there is a way to get read in a single keystroke at a
time in R as a string, akin to ncurses-style interfaces. I looked into
readLines, readChar, etc. using stdin, but these all require the use of an
end of line. Has anyone ever had need to do this or have any ideas on how
to do this?
Thanks,
Jon
PS I apologize if this double-sends, but I am having mail client issues.
2010 Oct 25
1
lowess() won't handle NAs
Dear Masters,
I'm driving crazy with the lowess() function....
my intent is smoothing confidence intervals for predicted y values in a
linear model lm() setting
since in the predict() function there exists an option for predicting NA
values, I instead encounter problems when I fit a missing values x variable
to the predicted terms.....,impossible task!!!
I've been banging on my head
2010 Nov 10
1
external R scripts
Is it possible to send data from an executing R script, to external R script files, on linux in this case, get that external R script to execute, and pass results back to the central script? If so what commands should I be looking at? I've googled for R and external, stuff like that but no luck.
The reason for the question is that I need to generate simulation data, then perform several
2010 Dec 07
3
string
Hi,
I'm running R 2.11
Does anyone know if it possible to transform one character vector to one
character string ?
Many thanks
Benoit
--
Benoit Wastine
Laboratoire des Sciences du Climat et de l?Environnement (LSCE/IPSL)
CEA-CNRS-UVSQ
CE Saclay
Orme des merisiers
B?t 703 - Pte 13A
91191 Gif sur Yvette Cedex
France
Tel : 33 (0)1 69 08 21 97
Fax : 33 (0)1 69 08 77 16
2010 Dec 15
1
Help about nlminb function
Hi Everyone,
Can anyone help me resolve a problem that i'm having with nlminb. The
problem is that it stops after just one iteration and returns the same
values as "start" ones.
Thank you very much for your help.
Sincerely.
--
Kamel Gaanoun
(+33) (0)6.76.04.65.77
[[alternative HTML version deleted]]
2011 Jan 10
2
how to wrap a long line in R scripts?
The guide of R Code style recommends to write script with a maximal
length of 80 characters?
how to break a line longer than 80 characters like
filename_name <- ("/blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/"/
blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/data.csv")
I did not find any answer while googling.
Thank you!
2011 Jan 19
1
Quantile Regression: Extracting Residuals
Dear R users
Is there a way to obtain the residuals from a model fitted by quantile
regression? Thank you.
Thanaset
--
View this message in context: http://r.789695.n4.nabble.com/Quantile-Regression-Extracting-Residuals-tp3225423p3225423.html
Sent from the R help mailing list archive at Nabble.com.
2011 Apr 12
1
Using help in Windows version of R with disabled browser
Dear colleagues,
I am trying to get someone to use R on MS Windows with the browser
disabled. My question is how does he/she get to use R-help which goes
off the browser (and correspondingly complains about the inability to
start firefox, etc). In linux, which is what I use, this is not a
problem: what needs to be set in Windows to replicate this behavior?
Sorry if I am not clear: please feel
2010 Dec 17
1
Alter plot point size by value of the plot value
R folks,
I am trying to create a mhtplot plot that will alter the point size via the plot point value. The size of the point should change via a set criteria such as:
if point value <10^-6 size 3x
else if 10^-3> point value >10^-6 size 2x
else point value >10^-3 size is x
I consider myself an R newbie, and I am assuming that I could do this via some sort of function to change
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.
2011 Feb 24
2
create dummy variables by for loop
HI, Dear R community,
I try to create 100 dummy variables like the following:
ack$id_1 <- (ack$ID==1)*1
ack$id_2 <- (ack$ID==2)*1
..
.
ack$id_100 <- (ack$ID==100)*1
I used the following codes:
for(i in 1:100){
ack$id_[i] <- (ack$ID==i)*1
}
But only one column is created, can anyone help me?
Thanks a lot!
--
Sincerely,
Changbin
--
2010 Dec 13
2
Integration with LaTex and LyX
Hello,
Are there any packages which allow for a good integration between R and
LaTex / LyX? I'm interested mainly in automatic (automagic?) imports of
plots/graphics.
Thanks in advance and best regards,
Eduardo de Oliveira Horta
[[alternative HTML version deleted]]
2010 Nov 04
1
cross-validation for choosing regression trees
Dear All,
We came across a problem when using the "tree" package to analyze our data
set.
First, in the "tree" function, if we use the default value "mindev=0.01",
the resulting regression tree has a single node. So, we set "mindev=0", and
obtain a tree with 931 terminal nodes.
However, when we further use the "cv.tree" function to run a 10-fold
2010 Dec 06
1
Optimize multiple variable sets
Hi,
I usually use optimize function for ML Estimation. Now I?ve got a data frame with many sets, but I can?t save estimates each time I run the code for each data set (I?m using a for loop with my loglikelihood function and works ok but when I apply another for loop to:
optimize(my.loglikelihood.function[i], int=c(0.0001,10))
it doesn?t work;
alternatively, using optimize inside the for loop
2011 Mar 02
2
Vector manipulations
I have a question regarding the most efficient way to select a substring of
a vector:
I have a vector of value v, and I want to select a subspace of this vector
called w such that:
w=v[1:n]
where
sum(w) = x
I am interested in what you thing would be the most efficient way to do this
- I would like to avoid slowing down my simulations as much as possible.
Thank you very much for any help that
2011 Apr 08
1
Estimates at each iteration
Dear Sir\ Madam
I am trying to maximise a complicated loglikelihood function via EM algorithm
which consists of two step "E-step and M-step"and in this case I need to
maximize the expected of like lihood function " which I get from E- step" and
take those estimates of parameter to update the E-step and repate these till
convargence has been met. So I need to know if I
2010 Oct 27
2
Generate random percentages and placing vectors
Hello everyone,
I have two questions:
1.) I would like to generate random percentages that add up to 100. For
example, if I need 5 percentages, I would obtain something like: 20, 30, 40,
5, 5. Is there some way to do this in R?
2.) I would like to insert vectors of specified length into a larger vector
of specified length randomly, and fill the gaps with zeroes. For example, if
I have 3 vectors
2011 Apr 11
1
RExcel
Hi, I am installing Excel using package "RExcelInstaller". When I tried to run
installRExcel()
I got this error message:
You don not have the R package rcom installed.
The (D)COM server installed which will aloow you to use the background server in
RExcel.
Since rcom is not installed, foreground mode will be unavailable.
You may continue with the installation, but in most