Displaying 20 results from an estimated 10000 matches similar to: "Simple Function"
2011 Jan 16
2
Time and xts
Hi all,
I have run into a problem and some help would be highly appreciated.
I have a .csv with the following columns:
Date Time Open High Low Close
1/2/2005 17:05 1.3546 1.3553 1.3546 1.35495
1/2/2005 17:10 1.3553 1.3556 1.3549 1.35525
1/2/2005 17:15 1.3556 1.35565 1.35515 1.3553
1/2/2005 17:25 1.355 1.3556 1.355 1.3555
?.
?..
2/13/2006 5:20 1.18895 1.18925 1.18835 1.1885
1)
2010 Nov 22
2
How to combine Date and time in one column
Hello everyone,
I am trying to built an xts object and i have run into some problems on the
data handling. I would really appreciate if someone could help me with the
following:
1) I have a OHLC dataset with Time and date in different columns. How could
i combine date and time in one column in order to pass on the new column to
xts? I have use cbind and data.frame before but i did not manage to
2010 Nov 09
2
Help with Iterator
Dear Experts,
The following is my "Iterator". When I try to write a new function with
itel, I got error.
This is what I have:
> supDist<-function(x,y) return(max(abs(x-y)))
>
> myIterator <- function(xinit,f,data=NULL,eps=1e-6,itmax=5,verbose=FALSE) {
+ xold<-xinit
+ itel<-0
+ repeat {
+ xnew<-f(xold,data)
+ if (verbose) {
+ cat(
+
2011 Feb 03
1
glmnet with binary predictors
Hi Everybody!
I must start with a declaration that I am a sparse user of R. I am
creating a credit scorecard using a dataset which has a variable
depicting actual credit history (good/bad) and 41 other variables of
yes/no type. The procedure I am asked to follow is to use a penalized
logistic procedure for variable selection. I have located the package
"glmnet" which gives the complete
2011 Sep 22
4
R CMD check file issues
This problem is likely to be specific to Windows, and particularly Win7.
After a successful build of a package (R CMD build addendum), I immediately
run an R CMD check for the same package.
Not always, but _very_ often, I get the following error:
C:\Users\nisabbe\Documents\@Doctoraat\R>R CMD check addendum
Loading required package: tcltk
Loading Tcl/Tk interface ... done
Loading
2011 Mar 04
3
Generic mixup?
Hello list.
This is from an R session (admittedly, I''m still using R 2.11.1):
> print
function (x, ...)
UseMethod("print")
<environment: namespace:base>
> showMethods("print")
Function "print":
<not a generic function>
Don''t the two results contradict each other? Or do I have a terrible
misunderstanding of what
2011 Jan 20
2
Using a list as multidimensional indexer
Hello list.
Another 'puzzle' for which I don't have a clean solution.
Say I have a multidimensional object, e.g.:
Mm<-matrix(1:6, nrow=2, dimnames=list(c("a","b"), c("g","h","i")))
And on the other hand I have a list
Ind<-list("b","g")
This holds, for each dimension, an indexer for that dimension.
Now I would
2010 Dec 08
2
problem accessing complex list data frames
Hi all.
I am currently attempting to build a list of sparse matrixes. That I have
already achieved, by
> vmat <- list()
> for (i in 1:n) {
> vmat <- c(vmat, sparseMatrix(i,j,x=data)
> }
How I am trying to select those elements from the list where the column e.g.
999 is not null. I can do this for one of the sparse matrices with
> which(vmat[[1]][,999] != 0)
which
2011 Jan 28
2
Injecting code in a package?
Dear list,
I''ve had this a few times now, and wonder if this is possible:
I''m using a package, often for plotting something, but I want to tune the
way the plotting goes, in a way that was not foreseen by the maker of the
package.
Now, most of the time, these kinds of R functions (say pkg::plot.something)
call into other R functions (say pkg::plot.something.internal), and
2010 Oct 22
2
Linking to lapack
Hello all.
I'm developing a package for R holding a Gibbs sampler, which tends to have
better performance when written in C than in R.
During each iteration in the Gibbs sampler, I need the inverse of a
symmetric matrix.
For this, I wish to use lapack, as is concisely suggested in "Writing R
extensions", since this will have better performance than I could ever write
myself.
After
2016 Sep 16
2
SCEV cannot compute the trip count of Simple loop
Hi All,
I am trying to unroll the below loop, but couldn't as SCEV returns TripCount as 0.
void foo(int x) {
int p, i = 1;
int mat[6][6][6];
for (p = x+3 ; p<= x+6 ;p++)
mat[x][p][i] = mat[x][p][i] + 5;
}
For a quick reference I have added the generated IR compiled with clang using -O3.
Please let me know if this is an known issue in SCEV or I am missing something here ?
;
2016 Sep 16
3
SCEV cannot compute the trip count of Simple loop
I have modified the example test case for UB error, still it didn’t unroll
void foo(int x) {
int p, i = 1;
int mat[9][9][9];
for (p = (x+1) ; p < (x+3) ;p++)
mat[x][p-1][i] = mat[x][p-1][i] + 5;
}
Regard,
Deepali
From: Kevin Choi [mailto:code.kchoi at gmail.com]
Sent: Friday, September 16, 2016 1:20 PM
To: Rai, Deepali
Cc: llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] SCEV
2011 Apr 01
3
programming: telling a function where to look for the entered variables
Hi there,
Could someone help me with the following programming problem..?
I have written a function that works for my intended purpose, but it
is quite closely tied to a particular dataframe and the names of the
variables in this dataframe. However, I'd like to use the same
function for different dataframes and variables. My problem is that
I'm not quite sure how to tell my function in
2011 Jan 28
1
plot not generic
Hello list.
I was trying to see some of the code for plot.glmnet in package glmnet (this
function name is in the documentation).
After loading the library, I tried the obvious typing in the name, but I
received a message telling me it could not be found.
So I fiddled around a little, and noticed that R does not recognize ''plot''
as a generic function, and as such,
2011 Apr 29
2
abline outside of plot region
Hi R people.
I ran into this problem: I created a plot with errbars, like this:
> errbar(x=c(1,2,3,4), y=c(2,1,3,3), yminus=c(1.5,0.5,2.5,2.5),
yplus=c(2.5,1.5,3.5,3.5))
Next, I wanted to accentuate some x value with an abline, like this:
> abline(v=2)
In one of my R sessions (which admittedly I have had open for quite a while
now), the abline draws outside of the plotting region
2010 Jul 11
2
simple apply syntax
I know this is a simple question, but I have yet to master the apply
statements. Any help would be appreciated.
I have a column of probabilities and sample sizes, I would like to create a
column of binomial random variables using those corresponding probabilities.
Eg.
mat = as.matrix(cbind(p=runif(10,0,1), n=rep(1:5)))
p n
[1,] 0.5093493 1
[2,] 0.4947375 2
[3,]
2004 Nov 29
1
Seeking help with a simple loop construction
Hello,
I have a df, pp, with five variables:
> nobs(pp)
q10_1 q10_2 q10_3 q10_4 actcode
1620 1620 1620 1620 1620
I want to create a loop to run four xtabs (the first four variables above by the fifth) and then store the results in a matrix. Below I make my intent clear by showing the output of one xtab which is inserted into a matrix.
> a <- xtabs(q10_1 ~
2010 Dec 07
1
Dataframe from list of similar lists: not _a_ way, but _the best_ way
Hi All.
I often find myself in this situation:
. Based on some vector (or list) of values, I need to calculate a
few new values for each of them, where some of the new values are numbers,
but some are more of descriptive nature (so: character strings)
. So I use e.g. sapply, passing a custom function that returns a
list with all the calculated values
. The result of
2011 May 12
2
Simple order() data frame question.
Clearly, I don't understand what order() is doing and as ususl the help for order seems to only confuse me more. For some reason I just don't follow the examples there. I must be missing something about the data frame sort there but what?
I originally wanted to reverse-order my data frame df1 (see below) by aa (a factor) but since this was not working I decided to simplify and order by
2011 Mar 31
3
choosing best 'match' for given factor
Folks,
I have a 'matching' matrix between variables A, X, L, O:
> a <- structure(c(1, 0.41, 0.58, 0.75, 0.41, 1, 0.6, 0.86, 0.58,
0.6, 1, 0.83, 0.75, 0.86, 0.83, 1), .Dim = c(4L, 4L), .Dimnames = list(
c("A", "X", "L", "O"), c("A", "X", "L", "O")))
> a
A X L O
A 1.00 0.41