Displaying 20 results from an estimated 91 matches for "100,10".
Did you mean:
100,13
2003 Dec 22
3
runif and sample with reproducibility
Hello,
I would like to sample a population but the result needs to be
reproducible, using 'runif' or 'sample' is the good way to do it but I
can't manage to make the results reproducible even with the 'set.seed'
function.
My aim is that th call to 'sample(1:100,10)' gives always the same result,
how can I do that?
Thanks!
Eric Esposito
2008 Nov 08
4
missing value where TRUE/FALSE needed
...ave the same length (10), but R gives me the following error:
Error in if (vector1[i] == vector2[j]) { :
missing value where TRUE/FALSE needed
I googled for possible solutions, but I did not find a good explanation
for this...
The code:
test <- function() {
vector1 <- sample(1:100,10)
vector2 <- sample(1:100,10)
for (i in vector1) {
for (j in vector2) {
if (vector1[i] == vector2[j]) {
show(list(i,j))
}
}
}...
2005 Dec 22
1
add factor to dataframe given ranges
Hi all,
I would like to factorize the entries in a dataframe given some
groupings. E.g:
mydf = data.frame(
a = rnorm(100,10),
b = rnorm(100,10),
c = rgamma(100, 1, scale=1))
group = hist(mydf$c, breaks="FD")
group$breaks
The idea is to create a factor "mydf$d" with levels corresponding to
the ranges in group$breaks.
There must be an easy way to do this that I haven't found out.
Thanks...
2019 Sep 23
2
[libnbd PATCH] ocaml: Fix tests when ocamlopt is not available
Fixes commit 42cb77be8c29de57f2f523688ea375762715d23f.
---
ocaml/tests/Makefile.am | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ocaml/tests/Makefile.am b/ocaml/tests/Makefile.am
index dfb23ff..56519c0 100644
--- a/ocaml/tests/Makefile.am
+++ b/ocaml/tests/Makefile.am
@@ -100,7 +100,10 @@ endif
TESTS_ENVIRONMENT = LIBNBD_DEBUG=1 OCAMLRUNPARAM=b
LOG_COMPILER = $(top_builddir)/run
-TESTS = $(tests_bc) $(tests_opt)
+TESTS = $(tests_bc)
+if HAVE_OCAMLOPT
+TESTS += $(tests_opt)
+endif
endif HAVE_NB...
2006 Jul 22
1
How to add a line on the boxplot
Hi,
I have a data frame,
> df=rnorm(1000)
> dim(df)=c(100,10)
>
And i can get the boxplot,
> boxplot(data.frame(df))
So how can add a line (aline) on the existing boxplot,eg,
aline=apply(df,2,max)
Thanks in advance.
[[alternative HTML version deleted]]
2013 May 11
1
How to repeat 2 functions in succession for 400 times? (microarray data)
Hi,
May be this helps:
?set.seed(24)
?mydata4<- as.data.frame(matrix(sample(1:100,10*38,replace=TRUE),ncol=38))
?dim(mydata4)
#[1] 10 38
?library(matrixStats)
res<-do.call(cbind,lapply(1:400, function(i) {permutation<-sample(mydata4); (rowMeans(permutation[,1:27])-rowMeans(permutation[,28:38]))/(rowSds(permutation[,1:27])+rowSds(permutation[,28:38]))} ))
?dim(res)
#[1]? 1...
2010 Dec 02
4
Integral of PDF
The integral of any probability density from -Inf to Inf should equal 1, correct? I don't understand last result below.
> integrate(function(x) dnorm(x, 0,1), -Inf, Inf)
1 with absolute error < 9.4e-05
> integrate(function(x) dnorm(x, 100,10), -Inf, Inf)
1 with absolute error < 0.00012
> integrate(function(x) dnorm(x, 500,50), -Inf, Inf)
8.410947e-11 with absolute error < 1.6e-10
> all.equal(integrate(function(x) dnorm(x, 500,50), -Inf, Inf)$value, 0)
[1] TRUE
> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-m...
2005 Jun 28
2
axTicks on a reverse ylog plot (PR#7973)
There is still issues with the reversed y-log scale plot:
# Test case A: works as expected
plot(10:100,log="y",ylim=c(100,11))
grid()
par("yaxp")
# Test case B: grid does not have horizontal lines; par("yaxp") is
different
plot(1:100,log="y",ylim=c(100,10))
grid()
par("yaxp")
In the second test case, axTicks for the horizontal lines (in grid())...
2008 Jul 07
5
question on lm or glm matrix of coeficients X test data terms
Hi,
is there an easy way to get the calculated weights in a regression equation?
for e.g.
if my model has 2 variables 1 and 2 with coefficient .05 and .6
how can I get the computed values for a test dataset for each coefficient?
data
var1,var2
10,100
so I want to get .5, 60 back in a vector. This is a one row example but I would want to get a matrix of multiplied out coefficients and terms for use in comparing contribution of variables to final score. As in a scorecard using logistic regression.
Please advise.
thanks
Dhruv
2019 Feb 21
1
[PATCH -next] drm/nouveau/dmem: remove set but not used variable 'drm'
...*drm;
^
Signed-off-by: YueHaibing <yuehaibing at huawei.com>
---
drivers/gpu/drm/nouveau/nouveau_dmem.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c
index aa9fec80492d..900a302b7ce9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dmem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c
@@ -100,12 +100,10 @@ static void
nouveau_dmem_free(struct hmm_devmem *devmem, struct page *page)
{
struct nouveau_dmem_chunk *chunk;
- struct nouveau_drm *drm;
unsigned long idx;
chunk = (void *)...
2008 Feb 28
1
calculate sd for each row on some columns of a dataframe
Hi,
I've got a dataframe like this:
df = data.frame(a=rnorm(100,1),b=rnorm(100,10),c=rnorm(100,100),d=rnorm(100,-100))
and I want to calculate sd1 for (a,b,c) for each entry, and sd2 for
(b,c,d) for each entry.
I don't seem to find the answer using aggregate or apply,
How can I do this?
Thanks in advance,
Cheers,
Albert.
2008 Dec 31
1
Problem with package SNOW on MacOS X 10.5.5
...ctions OK, but many of the higher level
(eg. parSApply) functions are generating errors.
When running the example (from the snow help docs) for parApply on
MacOSX 10.5.5, I get the
following error:
cl <- makeSOCKcluster(c("localhost","localhost"))
sum(parApply(cl, matrix(1:100,10), 1, sum))
Error in do.call("fun", lapply(args, enquote)) :
could not find function "fun"
Any ideas? Do I possibly need MPI or PVM to run the "Apply" functions?
Thanks,
--
Gregory Riddick, PhD.
CRTA Research Fellow
National Institutes of Health
National Ca...
2005 Apr 07
1
smbldap-tools patch - careful string handling
...the smbldap script "wrappers"). The
smbldap tools will issue funny warnings that help to sidetrack finding actual
problems...
Patch attached.
--- smbldap-tools-0.8.8/smbldap_tools.pm.org Mon Apr 4 02:03:34 2005
+++ smbldap-tools-0.8.8/smbldap_tools.pm Thu Apr 7 12:33:36 2005
@@ -100,10 +100,10 @@
## check for a param = value
if ($_=~/=/) {
my ($param,$val);
- if ($_=~/"/) {
+ if ($_=~/\s*.*?\s*=\s*".*"/) {
#my ($param,$val) = ($_=~/(.*)\s*=\s*"(.*)"/);
($param,$val) = /\s*(.*?)\s...
2011 Nov 06
3
sys/types.h -> linux/types.h and __aligned_u64
...u64)
and collides with klibc/usr/include/sys/types.h
/* Keeps linux/types.h from getting included elsewhere */
#define _LINUX_TYPES_H
not defining __aligned_u64 like the kernel's include/linux/types.h does.
Adding:
--- a/klibc/usr/include/sys/types.h
+++ b/klibc/usr/include/sys/types.h
@@ -100,6 +100,10 @@ typedef uint16_t __sum16;
typedef uint32_t __sum32;
typedef uint64_t __sum64;
+#define __aligned_u64 __u64 __attribute__((aligned(8)))
+#define __aligned_be64 __be64 __attribute__((aligned(8)))
+#define __aligned_le64 __le64 __attribute__((aligned(8)))
+
/*
* Some headers seem to...
2007 Feb 08
1
Queue extension issues
I'm stuck on queues!
The way I read what documentation I have found, if I set up a queue like
this:
[general]
persistentmembers = yes
[testq]
musiconhold=default
strategy = ringall
timeout = 10
retry = 5
context = testing
member => SIP/100
and then add into extensions something like this:
[incomingiax]
exten => 1234,1,Dial(SIP/100,10)
exten => 1234,2,Queue(testq|tTH|||300)
[testing]
exten => 1,1,Dial(SIP/101)
[testcontext]
exten => 100,1,Dial(SIP/100)
exten => 100,hint,SIP/100
exten => 101,1,Dial(SIP/101)
exte...
2003 Oct 27
1
Bioassays Yielding concentration-Mortality data
...le) into model formula.
Model in book:
pi(x)=gamma+(1-gamma)F(alpha+beta log(x))
F....cumulative probability distribution function
data:
x=concentration
n=number of insect at each run
y=number of death among n in given batch run at given concentration
Xmat<-data.frame(x=rep(c(0.01,0.1,1,10,100),2),n=rep(100,10),y=c(19,20,21,45,80,25,25,27,56,91))
Reults from book (obtained from SAS) are
intercept -1.6597 , beta =0.5586, control mortality --- gamma =0.2172
Thanks for any advice.
Michael
---
Odchozí zpráva neobsahuje viry.
Zkontrolováno antivirovým systémem AVG (http://www.grisoft.c...
2004 Jun 15
1
(sans objet)
Dear users
I have a problem with the dr function: "dimension reduction".
I give you my example, and i'll be pleased to read your comments.
#let be X a matrix 50*100:
library(dr);
X<- matrix(rnorm(50*100,5,1),50,100);
#and let be Y a vector response:
Y<- sample(0:1,50,replace=T);
#I choose (for the expérience, but in reality i don't have it) a few variables #which are censed to explain Y:
index<- sample(1:100,10);
X[Y==1,index]<-10*X[Y==1,in...
2007 May 27
1
Parametric bootstrapped Kolmogorov-Smirnov GoF: what's wrong
...GoF test (note package "Matching" provides "ks.boot" which is a 2-sample
non-parametric bootstrapped K-S version).
So I wrote this code:
---[R Code] ---
ks.test.bootnp <- function( x, dist, ..., alternative=c("two.sided", "less",
"greater"), B = 1000 )
{
n.x <- length(x);
cdf <- paste( "p", dist, sep="" );
rvg <- paste( "r", dist, sep="" ) ;
rvg <- get( rvg, mode = "function" );
ks <- ks.test( x, cdf, ..., alternative = alternative ); # K...
2019 Aug 26
2
[nbdkit PATCH] filters: Bump API version
...te bumps to
affected stable branches.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
I'm pushing this soon.
include/nbdkit-filter.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/nbdkit-filter.h b/include/nbdkit-filter.h
index 94f17789..1ebd1cb6 100644
--- a/include/nbdkit-filter.h
+++ b/include/nbdkit-filter.h
@@ -43,7 +43,7 @@
extern "C" {
#endif
-#define NBDKIT_FILTER_API_VERSION 2
+#define NBDKIT_FILTER_API_VERSION 5
struct nbdkit_extent {
uint64_t offset;
@@ -100,8 +100,10 @@ struct nbdkit_filter {
*/
int _api_ver...
2012 May 22
1
Adding Text to a Plot
Hi, all!
I'm pretty sure I'm missing something about this.
Is there a smart way of typping hat(R)^2 and it's value from a linear
regression?
I've just found this tricky one:
# Sample data
x <- sample(1:100,10)
y <- 2+3*x+rnorm(10)
# Run the regression
lm1 <- lm(y~x)
# Plotting
plot(x,y, main="Linear Regression", col="red")
abline(lm1, col="blue")
placex <- par("usr")[1]+.1*(par("usr")[2]-par("usr")[1])
placey1 <-...