Displaying 20 results from an estimated 30000 matches similar to: "split dataframe by sample()"
2012 Mar 07
5
Sampling problems
Hi,
I need to sample randomly my dataset for 1000 times. The sample need to be
the 80%. I know how to do that, my problem is that not only I need the 80%,
but I also need the corresponding 20% each time. Is there any way to do
that?
Alternatively, I was thinking to something like setdiff () function to
compare my 80% sample to the original dataset and obtain the corresponding
20%, unfortunately
2011 Dec 12
3
Variables from a Dataframe
Hello everyone,
I want make a variable selection from a dataframe, but when I build this new object (using cbind) the new table (which is a matrix) I lost all the original factor names in the variables. I get 1,2,3....
Someone would be so kind and tell me if there's is a ny way to get variables in a dataframe, but not changing these factor to numbers?
Thank you all.
José
[[alternative
2003 May 18
1
How to split a dataframe into smaller constituent dataframes
I have read a large dataset into a dataframe using RODBC, the rows of data
in the dataframe are (integer) timestamped and I would like to divide the
original dataframe into n smaller dataframes where dataframe 1 contains all
rows that had timestamps falling in the period 0-x1 minutes, dataframe 2
contains all rows that had timestamps falling between x1+1 and x2, etc..
Does anyone know how to
2010 Dec 31
2
dataframe, simulating data
Dear all,
I'm having trouble with my dataframe, and I hope someone can help me out...
I have data from 40 subjects, displayed in a dataframe. I have randomly
assigned subjects to group 1 or 0 (mar.y==0 or mar.y==1, with probabilities
used).
In the end, I want 34 cases assigned to group 0, with the rest of the
subjects assigned to group 1. However, if there are more than 34 cases
assigned to
2012 May 21
0
[LLVMdev] APInt::sdivrem error?
OK, the code for sdivrem in APInt.h is wrong.
Here's what's written:
static void sdivrem(const APInt &LHS, const APInt &RHS,
APInt &Quotient, APInt &Remainder) {
if (LHS.isNegative()) {
if (RHS.isNegative())
APInt::udivrem(-LHS, -RHS, Quotient, Remainder);
else
APInt::udivrem(-LHS, RHS, Quotient, Remainder);
Quotient =
2007 Aug 19
2
[LLVMdev] Tool support for generation of transactional code
I would like to announce the availability of compiler support for generation
of transactional code in LLVM IR. Our tool is called Tanger and it is an LLVM
pass. You can download Tanger at: http://tinystm.org
Transactional memory (TM) is viewed by a lot of people to be an important tool
for enabling parallelism in a wide area of applications, and especially for
developers that are not skilled
2018 Aug 03
2
Vectorizing remainder loop
>it cannot afford large size masks for large vectors
So, even a standard way of vectorizing remainder in masked or unmasked fashion wouldn’t work, I suppose. Ouch.
I suppose VPlan should be able to model this kind of gigantic remainder vector code (when the time comes). Not pretty at all, though.
Now, be fully aware that Direction #2 is really a poor (or rather extremely poor) person’s
2018 Aug 02
2
Vectorizing remainder loop
Hi Hameeza,
Aside from Ashutosh's patch.....
When the vector width is that large, we can't keep vectorizing remainder like below. It'll be a huge code size if nothing else ---- hitting ITLB miss because of this is very bad, for example.
VF=2048 // main vector loop
VF=1024 // vectorized remainder 1
VF=512 // vectorized remainder 2
...
Vectorize remainder until trip count is
2011 Oct 02
2
subset in dataframes
I need help in subseting a dataframe:
data1<-data.frame(year=c(2001,2002,2003,2004,2001,2002,2003,2004,
2001,2002,2003,2004,2001,2002,2003,2004),
firm=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),x=c(11,22,-32,25,-26,47,85,98,
101,14,87,56,12,43,67,54),
y=c(110,220,302,250,260,470,850,980,1010,140,870,560,120,430,670,540))
data1
I want to keep the firms where all x>0 (where there are
2008 Oct 30
2
[LLVMdev] Target description flags for instructions which may trap
What are the correct target description side effect flags for
instructions which may trap (e.g. divide / remainder)? The divide
instruction in my backend currently has no flags set. I've enabled the
MachineLICM pass and it's causing a miscompilation by hoisting a divide
by zero instruction out of the loop. Clearly this pass needs to be made
aware that this is not safe. The current
2012 Feb 22
3
inserting a dataframe into the table
Hi,
I have a dataset
X Y
A= 10 15
20 30
40 50
B = X Z
10 30
20 50
I have a table containing X Y Z columns
How to insert a data frame into the table without using for loop ?
now currently i'm using the for loop with using the insert command?
-----
Thanks in Advance
Arun
--
View this message in
2008 Apr 22
2
[LLVMdev] Google Summer of Code Projects
I'm happy to say that LLVM has 6 projects approved for Google SoC this
year (3x more than last year!):
[vmkit] "Generics support for N3" by Tilmann Schelle
[clang] "Adding support for C++ classes in clang" by Argiris
Kirtzidis
[codegen] "PSP (Playstation Portable) support into LLVM Mips
backend" by Bruno Cardoso Lopes
[llvmir]
2007 Jun 15
1
A question about logical controls and function arguements
Dear R-help subscribers,
I'm trying to write a function to generate data simulating the image
created by a point radiation source in a plane on a screen where there
is filter with a single circular aperture in it between the source and
the screen.
Following some guides (including Intro to R and some I found online) and
examples I have specified the function (full code below question) with
2010 Apr 23
2
Ogg Index A-mod
I've been looking over Benjamin Schwartz's Skeleton A-mod proposal. I've
been pretty busy with other projects over the past few months, so
haven't had a chance to look at Ogg indexing until now...
In general, I think Benjamin's ideas are sound, they're improvements,
and I'm open to being convinced to take them in the next index version.
We may as well get the index
2012 Feb 08
2
Split dataframe into new dataframes
Hi,
I want to split a dataframe based on a grouping variable (in one column). The resulting new
dataframes should be stored in a new variable. I tried to split the dataframe using split() and
to store it using a FOR loop, but thats not working so far:
df <- data.frame(A=c("A1","A1","A2","A2"),B=seq(1:4))
Fsplit <- function(x,y){
ls <-
2004 Aug 30
2
suggestions motivated by quest for remainders
Some time ago I tried to find out how to compute remainders in R.
I now know that it is done with %%, which is documented in help('+'),
but before someone told me that I tried:
help('remainder'), help.search('remainder'), apropos('remainder')
help('modulo'), help.search('modulo'), and apropos('modulo')
all of which yielded nothing.
I then
2003 Mar 30
1
[RFC][patch] dynamic rolling block and sum sizes II
Mark II of the patch set.
The first patch (dynsumlen2.patch) increments the protocol
version to support per-file dynamic block checksum sizes.
It is a prerequisite for varsumlen2.patch.
varsumlen2.patch implements per-file dynamic block and checksum
sizes.
The current block size calculation only applies to files
between 7MB and 160MB setting the block size to 1/10,0000 of
the file length for a
2008 Apr 22
0
[LLVMdev] Google Summer of Code Projects
On Tuesday 22 April 2008, Chris Lattner wrote:
> [llvmir] "Software Transactional Memory (STM) support in LLVM" by
> Luis Felipe Strano
Hi,
I'd like to know more about the directions for the STM project.
Somewhat contrary to what the project's abstract states, there are open C/C++
based implementations for compiler support for memory transactions. Besides
some
2009 May 29
3
IP-Address
Hi,
Is there any way to sort a tabel with a colum with IP-address?
table:
id rank color status ip
138 29746 yellow no 162.131.58.26
138 29746 red yes 162.131.58.16
138 29746 blue yes 162.131.58.10
138 29746 red no 162.131.58.17
138 29746 yellow no 162.131.58.14
138 29746 red no 162.131.58.13
138 29746 yellow no 162.132.58.15
139 29746 green no 162.252.20.69
140 29746 red yes
2003 Nov 18
2
sampling without repetition
Hi,
I'm trying to write a function that will divide a given range of
numbers into 3 sets using sample(), without repetition. Currently I'm
trying this approach:
r <- 1:10
s1 <- sample(r,size=3)
Next, I want to remove the selected elements from r and sample() from
the remainder.
r <- r[ -(r=s1) ]
s2 <- sample(r,size=3)
When I go to remove the elements contained in s2 from