Displaying 20 results from an estimated 300 matches similar to: "formatting a 6 million row data set; creating a censoring variable"
2007 Sep 16
1
programming question
Dear list,
I have a vector of numbers, let's say:
myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219)
My task is to reduce this vector to non-reducible numbers; small numbers can
cross-out some of the larger ones, based on a function let's say called
reduce()
If I apply the function to the first element 2, my vector gets shorted to:
> (myvec <- reduce(myvec[1]))
[1] 2 24 51
2015 May 04
2
[LLVMdev] Incorrect code generated for arm64
Hi all,
I’ve narrowed down a problem in my code to the following test case:
- - - -
typedef struct {float v[2];} vec2;
typedef struct {float v[3];} vec3;
vec2 getVec2();
vec3 getVec3()
{
vec2 myVec = getVec2();
vec3 res;
res.v[0] = myVec.v[0];
res.v[1] = myVec.v[1];
res.v[2] = 1;
return res;
}
- - - -
Compiling this with any level of optimization for arm64 gives incorrect code,
2015 May 04
2
[LLVMdev] Incorrect code generated for arm64
Thanks Bruce.
> On 4 May 2015, at 13:18, Bruce Hoult <bruce at hoult.org> wrote:
>
> I can confirm that, with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
>
> Very strange!
Yes, that’s what I thought. I’ve also checked the binary downloads for OS X from llvm.org <http://llvm.org/> and get the same broken code from both the 3.5.2 and 3.6.0 releases.
2008 Jun 23
2
Writing Vector to a File
Dear experts,
I try not to trouble the list again after this question.
I want to print this vector into a file
> myvec
[1] --Control --Control --Control --Control --Control HBA2 HBA1
[8] HBA1 --Control HBB --Control HBB HBA1 MBP
[15] --Control HBA1 HBA2 HBB PTGDS GAPDH UBC
[22] --Control GAPDH TPT1 HUWE1 PRM1 CKM
2003 Jun 26
2
Plots using POSIX
Is there a reason that the bottom axis changes color when POSIX data is used
in plot function?
For example:
> timedata <- c("2/3/2003","3/4/2003","5/4/2003")
> timedata2 <- strptime(timedata,format="%m/%d/%Y")
> numdata <- c(2,3,4)
> plot(as.POSIXct(timedata2),numdata,col="red",type="o")
As compared to:
>
2012 Oct 31
1
ffdfindexget from package ff
I'm having trouble getting ffdfindexget to work right in Windows. Even the
most trivial of examples gives me problems.
> myVec = ff(1:5)
> another = ff(10:14)
> littleFrame = ffdf(myVec, another)
> posVec = ff(c(2, 4), vmode = 'integer')
> ffdfindexget(littleFrame, posVec)
Error in if (any(B < 1)) stop("B too small") :
missing value where TRUE/FALSE
2011 Apr 05
1
do not execute newline command
Hi R-users,
To automate the creation of scripts, I converted the code (example below) into a character string and wrote the object to a file:
Repeat <- "
myvec <- c(1:12)
cat('vector= ', myvec, '\n')
"
write (Repeat, 'yourpath/test.R')
the problem is that one line of the code is a "cat" command. In the output file (i.e. test.R), the newline
2007 Jan 30
6
jump in sequence
Dear list,
This should be a simple one, I just cannot see it.
I need to generate a sequence of the form:
4 5 6 13 14 15 22 23 24
That is: starting with 4, make a 3 numbers sequence, jump 6, then another 3
and so on.
I can create a whole vector with:
myvec <- rep(rep(c(F, T, F), rep(3, 3)), 3)
Then see which are TRUE:
which(myvec)
[1] 4 5 6 13 14 15 22 23 24
I'd like to avoid
2010 Mar 24
1
isdst warning when rounding a range of time data: fix or suppress?
Hi, I'm working with timeseries data. The values are every 5 seconds and each series can last up to 4-5 days.
To generate the x-axis labels, I'm doing the following:
=========================
# Variable for displaying hours on the x-axis
rtime <<- as.POSIXct(round(range(timedata), "hours"))
# Variable for displaying days on the x-axis
stime <<-
2009 Dec 20
1
How to put text outside an xyplot?
Dear R-users,
I have a plot created with the code below. I tried to put some text to the right of the color key. I worked with grid.text and also viewport(), but couldn't achieve this. I know this should be simple, but I just couldn't figure out how to do it. How does this work?
Cheers,
Marius
library(lattice)
library(grid)
myvec=1:10
data=data.frame(x=myvec,y=myvec)
2011 Jan 19
1
Printing "pretty' vectors in Sweave
I am trying to print a nice looking vector in Sweave.
c <- 1:4
I want to see (1, 2, 3, 4) in TeX. .
If I use
paste(c, ",", sep="")
I get
"1," "2," "3," "4,"
If use cat(c, sep=",")
I can't seem to assign it to an object,
1,2,3,4> myvec <- cat(c, sep=",")
1,2,3,4> myvec
NULL
and if I bypass the
2013 Nov 21
1
[PATCH] suggestions for R-lang manual
Attached is a patch with suggestions for the R-lang manual at r64277.
Below are a few comments (some are implemented in the patch):
In the section "Objects", there is a table introduced by "The
following table describes the possible values returned by typeof". One
of the results is "any". Can "any" be returned by "typeof()" ?
Regarding the
2013 Oct 15
2
A 'good' way to build a matrix from a sequence of integers?
# I understand that a good way to build a vector from a sequence of integers,
# is to use syntax like this:
myvec = c(1:99)
# Here is the 'short' version of my question:
# I want to understand a 'good' way to build a matrix from a sequence of integers.
# If that question is not clear, here is a longer version:
# Here is what I did for a 1D-matrix:
# I pick the sequence 1:3
# I
2011 Dec 21
2
unique combinations
Hi there,
I have a vector and would like to create a data frame, which contains
all unique combination of two elements, regardless of order.
myVec <- c(1,2,3)
what expand.grid does:
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
what I would like to have
1,1
1,2
1,3
2,2
2,3
3,3
Can anybody help?
2012 Apr 17
2
[LLVMdev] Issue with GetElementPtrInst in Instruction Combining pass
Hi All,
I have been having this issue, when I am enable Instruction Combining pass, for an application.
I have read similar post ealier,
http://old.nabble.com/Instruction-Combining-Pass-*Breaking*-Struct-Reads--td24253572.html
With reference to the above case, my target data layout is defined as:
DataLayout("e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-a:32:32")
Thus I don't see
2012 Apr 17
2
[LLVMdev] Issue with GetElementPtrInst in Instruction Combining pass
With reference to the previous query,
I think, i miscalculated the offset, just recalculating.
1. without instruction combining
coupling member variable, is at:
%struct._FRAME_DATA* %2, i32 0, i32 5
where "%2" is defined as:
%arrayidx3 = getelementptr inbounds i16* %Data, i32 1024, !dbg !446
%2 = bitcast i16* %arrayidx3 to %struct._FRAME_DATA*, !dbg !446
i.e. at 5 offset in
2011 Feb 14
3
how to order POSIXt objects ?
I have a problem ordering by descending magnitude a POSIXt object. Can
someone help please and let me know how to work around this. My goal is to
be able to order my data by DATE and then by descending TIME.
I have tried to include as much info as possible below. The problem stems
from trying to read in times from a CSV file. I have converted the character
time values to a POSIXt object using the
2009 Aug 13
3
Finding minimum of time subset
Dear List,
I have a data frame of data taken every few seconds. I would like to subset the data to retain only the data taken on the quarter hour, and as close to the quarter hour as possible. So far I have figured out how to subset the data to the quarter hour, but not how to keep only the minimum time for each quarter hour.
For example:
2008 Oct 13
3
lattice panel question
Dear R users,
How to change lattice panel label/text from the automatically generated
label (based on the conditioning) to our own set of label?
for example:
someStuff <- data.frame(area = rep(c("SOUTH", "NORTH", "EAST", "WEST"), each
= 25),
group = rep(c("A","B","C","D"), each = 5),
2007 Mar 16
1
Rownames are always character?
Gurus,
Can I rely on the rownames() function, when applied to a matrix,
always returning either NULL or an object of type character? It
seems that row names can be entered as integers, but as of now
(R 2.4.1 on Windows) the function returns character vectors, not
numbers (which is my desired result).
I am using elements of the returned vector to index the matrix.
e.g.,
nams <-