Displaying 20 results from an estimated 37 matches for "testf".
Did you mean:
test
2003 Oct 31
1
strange sprintf() behaviour ?
This is quite strange behaviour - at least for R-novice as myself....
Consider this:
> testf <- function() { x <-2; sprintf("%s %f", "x =", x); return(x) }
> result <- testf()
> testf <- function() { x <-2; sprintf("%s %f", "x =", x) }
> result <- testf()
> testf()
[1] "x = 2.000000"
Apparently adding return(...
2004 Dec 22
4
ordering levels
Hello!
I would like to know if there is a simple way to reorder levels of a given factor.Let's say that the vector
testf<-factor(c("red","red","red","blue","blue","white"))
levels(testf) : blue red white
should have reordered levels such as
levels(testf) : red blue white
(this is for presentation purposes)
I guess I'm looking for a gener...
2005 Oct 05
2
problem accumulating array within a function over loops
...y seems to re-set at every entry to the
function. Here is an example, so you can see what I mean.
########################################################################
#First, I declare the array and loop control variables
maxrun=3; a=array(NA, c(3,5)); run=0
# Then I define the function "testf"
testf=function(x,y){
print(paste('Run:',run)) #check that the function knows about "run"
a[run,1:3]=runif(3); a[run,4]=x; a[run,5]=y #collect numbers into array "a"
print(paste("Row", run, "of a:")); print(a[run,]) #check what row 'run'...
2008 Oct 20
1
[LLVMdev] mixed bc file
...llvm-ld can combine different bc files compiled from C programme and Fortran Programme together?
For example:
Compile a c program into llvm bc file by the task:
# llvm-gcc -emit-llvm test.c -c -o test.bc
and then compile a fortran program into llvm bc file by the task:
# llvm-gfortran -emit-llvm testf.f -c -o testf.bc
And then use llvm-ld to combine two bc files into a single bc file as follows:
# llvm-ld test.bc testf.bc -o testp.bc
# ./testp.bc
ERROR: Program used external function '_gfortran_st_write' which could not be resolved!
lli[0x85c245f]
/lib/libc.so.6(abort+0x101)[0x6988b1]
l...
2004 Dec 22
2
RE ordering levels
Sorry, sorry....
of course
levels(testf)[c(2,1,3)]
will do the job
My excuses to all
Anne
PS I will meditate the following saying
"la parole est d'argent et le silence est d'or"
BONNES FETES A TOUS
SEASONAL GREETINGS
----------------------------------------------------
Anne Piotet
Tel: +41 79 359 83 32 (mobile)
E...
2012 Apr 17
4
parallel processing with multiple directories
...tried the following code without success. The error I get is: "Error in setwd(x) : cannot change working directory"
library(parallel)
dirs <- list("out1","out2","out3") # these directories are located within the current working directory
temp <- 1:3
testF <- function(x) {
setwd(x)
saveRDS(temp,"temp.drs")
}
mclapply(dirs, testF)
Any help would be appreciated!
--David
*********************************************
David R. Schaefer, Ph.D.
Assistant Professor
School of Social and Family Dynamics
Arizona State University
www.public...
2004 Dec 22
0
ordering levels: I was wrong
I was wrong about needing the Relevel from the Lexis package.
The default verson of relevel does the job of reshuffling levels
in any desired order, albeit with a warning (which comes from the
fact that apparently only a single number had been anticipated by
the designer):
> testf <- factor( sample( letters[1:4], 100, replace=T ) )
> table( testf, newf=relevel( testf, ref=c(3,2,1,4) ) )
newf
testf c b a d
a 0 0 21 0
b 0 21 0 0
c 32 0 0 0
d 0 0 0 26
Warning message:
the condition has length > 1 and only the first element will be...
2009 Apr 29
0
combine_factor to empty level
ID: T8dfe471e360ac80264c6c
Dear,
I'm using R 2.8.1 with the package reshape version 0.8.2 .
It seems that the combine_factor function has problems with combining levels to
an empty level:
#EXAMPLE WORKING
test<-sample(c(1:10),1000,replace=T)
testf<-factor(test, c(1:10), LETTERS[1:10])
table(testf,exclude=NULL)
testc<-combine_factor(testf, c(1,1,1,1,1,2,2,2,2,2))
levels(testc)<-c("A-E","F-J")
table(testc,exclude=NULL)
#EXAMPLE NOT WORKING
test<-sample(c(1:5),1000,replace=T)
testf<-factor(test, c(1:10), LETT...
2004 Dec 22
0
relevel expansion suggestion
...ls: I was wrong
I was wrong about needing the Relevel from the Lexis package.
The default verson of relevel does the job of reshuffling levels in any
desired order, albeit with a warning (which comes from the fact that
apparently only a single number had been anticipated by
the designer):
> testf <- factor( sample( letters[1:4], 100, replace=T ) ) table(
> testf, newf=relevel( testf, ref=c(3,2,1,4) ) )
newf
testf c b a d
a 0 0 21 0
b 0 21 0 0
c 32 0 0 0
d 0 0 0 26
Warning message:
the condition has length > 1 and only the first element will be...
2006 Sep 13
0
how to list clones for a snapshot
Hello,
Is there a way how to list all clones for given snapshot of a file-
system ?
e.g. I have the following snapshots:
local/testfs at sunday
local/testfs at monday
local/testfs at tuesday
and clone local/tuesday of local/testfs at tuesday. Now I''d like to get
local/tuesday using
local/testfs at tuesday as input.
v.
2012 Jan 06
6
cbind alternate
I have two one dimensional list of elements and want to perform cbind and
then write into a file. The number of entries are more than a million in
both lists. R is taking a lot of time performing this operation.
Is there any alternate way to perform cbind?
x = table1[1:1000000,1]
y = table2[1:1000000,5]
z = cbind(x,y) //hanging the machine
write.table(z,'out.txt)
--
-------------
2007 Nov 26
15
bad 1.6.3 striped write performance
...1.6.3smp, "" . fabric gigE
d) servers centos4.5, 2.6.9-55.0.9.EL_lustre.1.6.3smp, "" , fabric gigE
all runs have the same setup - two OSS''s, each with a 16 FC disk md
raid5 OST clients with 512m ram, server with 8g, all x86_64, test is
dd if=/dev/zero of=/mnt/testfs/blah bs=1M count=5000
each test run >=2 times. there are no errors from lustre or kernels.
I can''t see anything relevant in bugzilla.
is anyone else seeing this?
seems weird that 1.6.3 has been out there for a while and nobody else
has reported it, but I can''t think or any mo...
2011 Sep 07
1
access objects
...unction, with the number given as an argument.
Where can I find help on how to do that? Somebody must have been trying to do this before...
Some keywords to start a search are appreciated as well.
Here's an example, I hope it clarifies what I'm trying to do:
obj1 <- 7:9
obj2 <- 6:2
testf <- function(k) plot(? noquote(paste("obj", k, sep=""))? )
testf(1) # should plot obj1
-------------------------------------
Berry Boessenkool
D-14476 Potsdam (OT Golm)
-------------------------------------
2007 Jan 31
7
features of save and save.image (unexpected file sizes)
Hi,
Today I came upon unexpected R behaviour. I did some modelling and the
result was R object, about 28MB size (nested list, with matrixes as
list elements). When I was saving the session with save.image, the
resulting .RData file was 300MB. There were no other large objects:
>
2008 Oct 15
0
[LLVMdev] LLVM 2.4 problem? (resend)
Tatu Vaajalahti wrote:
> With this program llvm-gcc -O2 optimizes test2 away even though it's
> address is taken in program (gcc-4.2 does not, neither does llvm-gcc
> with -O or -O0):
>
>
> #include <stdio.h>
>
> static const char test1 = 'x';
> static const char test2 = 'x';
>
> int main(int argc, char **argv)
> {
>
2012 Jan 13
2
question: how to select a column from a dataframe in a function
Hi,
I am creating a function and ran into the problem of selecting a column
from a dataset. It seems as though the $ function (as in data$columnname)
does not apply in the function. In simplified version:
This works:
testf2<-function(data,columnnumber){print(data[,columnnumber])}
But this doesn't:
testf<-function(data,column){print(data$column)}
Even though the first solution works, I would like to be able to insert the
columnname in the function, instead of the columnnumber. How do I do that?
Thank you...
2008 Oct 15
4
[LLVMdev] LLVM 2.4 problem? (resend)
On 15.10.2008, at 3.42, Chris Lattner wrote:
>
> On Oct 14, 2008, at 12:52 PM, Tatu Vaajalahti wrote:
>
>>
>> Hi,
>>
>> I don't know enough C to know for certain if this is a programmer or
>> compiler error:
>
> Hi Tatu,
>
> With this information it is impossible to tell if it is your fault or
> llvm's fault. Please file a bug with a
2008 Oct 15
6
[LLVMdev] LLVM 2.4 problem? (resend)
...e unit.
True, but note that it is the address of a variable that is used, not
the value.
What is more troublesome is that llvm-gcc combines these also across
files with -O4:
test.c:
#include <stdio.h>
static const char test1 = 'a';
static const char test2 = 'a';
void testf();
int main(int argc, char **argv)
{
printf("%p\n", &test1);
printf("%p\n", &test2);
testf();
return 0;
}
test2.c:
#include <stdio.h>
static const char test1 = 'a';
static const char test2 = 'a';
void testf(void)
{
printf("...
2008 Jan 02
9
lustre quota problems
...a given value (e.g. the values which
are provided in the operations manual), I''m able to write exact the amount
which is set with setquota.
But when I delete the files(file) I''m not able to use this space again.
Here is what I''ve done in detail:
lfs checkquota -ug /mnt/testfs
lfs setquota -u winnie 307200 309200 10000 11000 /mnt/testfs
Now I wrote one single big file with dd.
dd if=/dev/zero of=/mnt/testfs/test
As expected it stops writing the file after it is ~300 MB large.
Removing this file and restarting dd leads to a zero-sized file, because
the disk quota is...
2007 Mar 20
15
How to bypass failed OST without blocking?
Hi
I want my lustre do such things during OST failed: if some file
has stripe data on th failed OST, any operation on the file will
return IO error without blocking, and also at this moment I can
create and read/write new file or read/write files which have no stripe
data on the failed OST without blocking.
What should I do ? How to configure?
thanks!
swin
-------------- next part