Displaying 20 results from an estimated 40000 matches similar to: "confusion with R syntax"
2007 Oct 12
2
Plotting question
I am constructing plots ( regular not lattice ) and my initial command
is
par(mar=c(3,4,2,2), mfcol=c(5,2))
and then I create 10 plots on the page. It looks great but the plots on
the page go in the order
1 6
2 7
3 8
4 9
5 10
Where the numbers denote decile breakdowns.
Is there an easy way to make them go from left to right so
1 2
3 4
5 6
7 8
9 10
I could try
2006 Nov 12
7
I think a simple question
I have index ( of a vector ) values of say
tempin<-c(1 31 61 91 121 all the way upto 1411)
What I want is a function that takes in a number say, x = 5, and gives
me an new vector
of
tempout<-1 6 31 36 91 96 121 126 .......... 1411 1416
This can't be so hard but I can't get it and I've honestly tried.
Obviously, tempin + 5 gives me the missing values but I
2007 Sep 04
2
Confusion using "functions to access the function call stack" example section
I was going through the example below which is taken from the example
section in the R documentation for accessing the function call stack.
I am confused and I have 3 questions that I was hoping someone could
answer.
1) why is y equal to zero even though the call was done with gg(3)
2) what does parents are 0,1,2,0,4,5,6,7 mean ? I understand what a
parent frame is but how do the #'s relate
2006 Nov 14
2
putting a column name on a zoo object
does anyone know how to put a column name on a zoo object. I think achim
and gabor are off line or they have gotten totally tired of me
an decided to ignore me ( which is totalyy understandable ).
logbidask<-log((aggfxdata[,"bid"] + aggfxdata[,"ask"])/2.0)
logbidask doesn't have a name and I can't figure out how to get one on
it ?
aggfxdata is a zoo object.
2007 Jun 12
3
Panel data
Dear all R users,
I have a small doubt about panel data analysis. My basic understanding on Panel data is a type of data that is collected over time and subjects. Vector Autoregressive Model (VAR) model used on this type of data. Therefore can I say that, one of statistical tools used for analysis of panel data is VAR model? If you clarify my doubt I will be very grateful.
Thanks and regards,
2007 Aug 24
4
Turning a logical vector into its indices without losing its length
I have the code below which gives me what I want for temp based on
logvec but I was wondering if there was a shorter way ( i.e :
a one liner ) without having to initialize temp to zeros. This is
purely for learning purposes. Thanks.
logvec <- c(TRUE,FALSE,FALSE,TRUE,FALSE,FALSE,TRUE,FALSE)
temp<-numeric(length(invec))
temp[invec]<-which(invec)
temp
[1] 1 0 0 4 0 0 7 0
obviously, the
2007 Mar 09
4
Using large datasets: can I overload the subscript operator?
Hello,
I do some computations on datasets that come from climate models. These data
are huge arrays, significantly larger than typically available RAM, so they
have to be accessed row-by-row, or rather slice-by slice, depending on the
task. I would like to make an R package to easily access such datasets
within R. The C++ backend is ready and being used under Windows/.Net/Visual
Basic, but I have
2006 Nov 29
3
better define: matrix comparison and cbind issue
Hello,
Sorry to all for the lack of communication, and thanks to those with the
suggestions.
So I have two matrixes which are different sizes, same column number but
different row number.
What I would like to do is to compare A to B. In the 6 and 9th column there
are ref numbers (molecular masses to be exact). I would like to check A and
B by these columns. If I find that the number in A[9,x]
2006 Oct 24
6
extract certain values from a ts
Hi,
Having several daily wind speed time series I want to extract those
consecutive days over and below certain values (i.e. 5 < x <8) Don't
know which funtion to use (aggregate, lapply?) and how to do it.
Thanks in advance
Antonio
2006 Oct 24
4
How to start R with a file loaded?
Hi!
I've made great progress in my R programming, but I am again stuck on a
beginner's problem.
I would like to start R with a command line that loads a file, and if
possible, executes a function.
Can anyone give me an example of how to do this?
For example, in lisp, I would say:
$ lisp -load toto.lisp -eval '(do-something $PORT)'
to load the file "toto.lisp", then
2006 Nov 25
3
Multiple Conditional Tranformations
Greetings,
I'm learning R and I'm stuck on a basic concept: how to specify a
logical condition once and then perform multiple transformations under
that condition. The program below is simplified to demonstrate the goal.
Its results are exactly what I want, but I would like to check the
logical state of gender only once and create both (or any number of)
scores at once.
2019 Jul 21
6
[RFC] A new multidimensional array indexing intrinsic
Hello,
We would like to begin discussions around a new set of intrinsics, to
better express
multi-dimensional array indexing within LLVM. The motivations and a
possible design
are sketched out below.
Rendered RFC link here
<https://github.com/bollu/llvm-multidim-array-indexing-proposal/blob/master/RFC.md>
Raw markdown:
# Introducing a new multidimensional array indexing intrinsic
## The
2006 Oct 17
3
barplot question
i'm doing a bar plot and there are 16 column variables. is there a way
to make the variable names go down instead of across when you do the
barplot ?
because the names are so long, the barplot just shows 3 names and leaves
the rest out. if i could rotate the names 90 degrees, it would probably
fit a lot more.
or maybe i can use space to make the horizontal width longer ? I looed
up ?barlot but
2007 Aug 31
3
Choosing the optimum lag order of ARIMA model
Dear all R users,
I am really struggling to determine the most appropriate lag order of ARIMA model. My understanding is that, as for MA [q] model the auto correlation coeff vanishes after q lag, it says the MA order of a ARIMA model, and for a AR[p] model partial autocorrelation vanishes after p lags it helps to determine the AR lag. And most appropriate model choosed by this argument gives
2007 Apr 16
1
Names in vector occurring in another vector
I have a vector of character strings such as
mainnames<-c("CAD","AUD") and another vector say
checknames<-c("CAD.l1","AUD.l1","JPY.l1","EUR.l1","CAD.l2","AUD.l2","JPY
.l2","EUR.l2")
I want a new vector of character strings that is just
2019 Jul 22
3
[RFC] A new multidimensional array indexing intrinsic
Am Mo., 22. Juli 2019 um 10:50 Uhr schrieb Doerfert, Johannes
<jdoerfert at anl.gov>:
> Why introduce a new intrinsic (family)? It seems that would require us
> to support GEPs and GEP + "multi-dim" semantics in various places. What is
> the benefit over a GEP extension?
Adding an intrinsic is easier than adding or extending an existing
instruction, as suggested by
2007 Sep 11
6
xyplot question
I have the code below and it works fine if I print the xyplot but if I
take the print out, then I just get a blank
pdf. The same holds if I just send the plot to the console without the
print ( I get nothing ). My question is whether this is always
the case with xyplot or is there something wrong with my settings ? I am
on linux ( redhat ) and using R.2.5.0. Thanks.
load("stocks.dat")
2004 Sep 03
1
Different Index behaviors of Array and Matrix
Dear all,
I found a difference between the indexing of an array and that of a matrix when there are NA's in the index array. The screen copy is as follows.
> A <- array(NA, dim=6)
> A
[1] NA NA NA NA NA NA
> idx <- c(1,NA,NA,4,5,6)
> B <- c(10,20,30,40,50,60)
> A[idx] <- B
> A
[1] 10 NA NA 40 50 60
> AA <- matrix(NA,6,1)
> AA
[,1]
[1,] NA
[2,]
2006 Oct 18
2
not understanding a do.call
I did a ?do.call but i don't think i understand it.
if a, b,c,d are numeric vectors then could someone explain the
difference between
do.call("cbind",list(a,b,c,d))
and cbind(a,b,c,d).
or point to an archive on it.
the return value of cbind is a matrix or dataframe depending on what is
sent in but i don't
understand wheen it would be useful to use do.call. i realize it
2011 Feb 14
8
[LLVMdev] LLVMdev Digest, Vol 80, Issue 13
Andrew,
your response highlights a naming problem in LLVM,
which is that "array" and "vector"
mean the same thing in normal computer language and compiler theory
usage, so it is
inconvenient and misleading within LLVM to give one a very specific
meaning that is different
from the other....
to the LLVM developers I would suggest using the term