Displaying 20 results from an estimated 65 matches for "sample2".
Did you mean:
sample
2015 Oct 09
4
A where() functions that does what exists() does but return the environment when object lives?
...er an object named "foo"
exists, and get("foo", inherits=TRUE) retrieves it. I'm looking for a
similar function to exists() that returns the environment where the
object "foo" exists, iff at all. If not found, NULL is returned.
Does that exist?
EXAMPLE #1:
> sample2 <- base::sample
> env <- where("sample2", inherits=TRUE)
> env
<environment: R_GlobalEnv>
Note the difference to:
> obj <- get("sample2", inherits=TRUE)
> environment(obj)
<environment: namespace:base>
EXAMPLE #2:
> a <- 1
> foo <...
2010 Mar 18
0
[LLVMdev] How to link LLVMCore.a into a custom pass that is fed to opt
...pass). However, this requires that I link in LLVMCore to provide said
bindings to my library. From what I've read, there is a known issue with
linking LLVMCore into a module that is fed to opt. Namely, you get the
following assertion:
[posera ~]$ opt -load "downloads/llvm2.6/Debug/lib/Sample2.so" --sample2
test.bc
opt: Pass.cpp:152: void<unnamed>::PassRegistrar::RegisterPass(const
llvm::PassInfo&): Assertion `Inserted && "Pass registered multiple times!"'
failed.
Aborted
Typically people ran into this problem by following the Pass authoring
tutorial...
2008 Oct 16
1
apply, t-test and p-values
R 2.7.2
Windows XP
I am using apply to compute a series of Student's t-test from two matrices, sample1 and sample2.
boo<-apply(sample1,1,t.test,sample2)
I want to pick of the p-values from the tests, but can't seem to get it to work. I have tried several methods to get the values including:
boo<-apply(sample1,1,t.test$t.test,sample2)
boo<-apply(sample1,1,t.test,sample2)$t.test
any suggestions?...
2010 Nov 02
2
One question on heatmap
Dear R-helper:
Suppose we have a matrix:
Gene sample1 sample2
Gcnt1 12.0000 52.80000
Max 8.8000 39.10000
Tmem176b 67.9000 304.70000
Shmt2 8.6000 42.40000
Rtn4 11.5000 57.70000
Il17re 7.6000 38.80000
Bclp2 6.2000 32.10000
Mobkl3 4.4000 32.20000
Ak...
2011 Sep 26
1
How to Store the executed values in a dataframe & rle function
Hi group,
This is how my test file looks like:
Chr start end sample1 sample2
chr2 9896633 9896683 0 0
chr2 9896639 9896690 0 0
chr2 14314039 14314098 0 -0.35
chr2 14404467 14404502 0 -0.35
chr2 14421718 14421777 -0.43 -0.35
chr2 16031710 16031769 -0.43 -0.35
chr2 16036178 16036237 -0.43 -0.35
chr2 16048665 16048724 -0.43 -0.35
chr2 37491676 37491735 0 0
chr2 37702...
2012 Dec 04
2
computing marginal values based on multiple columns?
Hello all,
I have what feels like a simple problem, but I can't find an simple
answer. Consider this data frame:
> x <- data.frame(sample1=c(35,176,182,193,124),
sample2=c(198,176,190,23,15), sample3=c(12,154,21,191,156),
class=c('a','a','c','b','c'))
> x
sample1 sample2 sample3 class
1 35 198 12 a
2 176 176 154 a
3 182 190 21 c
4 193 23 191 b
5 124...
2011 Aug 14
2
conditional filter resulting in 2 new dataframes
This is what I am starting with:
initial<- matrix(c(1,5,4,8,4,4,8,6,4,2,7,5,4,5,3,2,4,6), nrow=6,
ncol=3,dimnames=list(c("1900","1901","1902","1903","1904","1905"),
c("sample1","sample2","sample3")))
And I need to apply a filter (in this case, any value <5) to give me one
dataframe with only the 'less than 5' values and with '0' place holders on
the values that don't meet this criteria. The second dataframe is the same
but for those values &g...
2018 Jan 24
2
Issue with concatenation of URL losing
Thank you for your help in advance.
I am trying to pull some data back from a web service
library(httr)
sample2 <- GET("https://elevation.mapzen.com/height?json={\"range\":false,\"shape\":[{\"lat\":40.7,\"lon\":-76.5}]}&api_key=mycode")
result2 <- content(sample2)
height <- result2$height[[1]]
I would like to put by own latitude and longitude i...
2009 Feb 02
1
A question regarding bootstrap
...s,
I have two small samples (n=20), the distributions are highly skewed. Does
it make any sense to do a boostrap test to check for difference in means?
And if so, could this be done like this:
x <- numeric(10000)
for(i in 1:10000) {
x[i] <- mean(sample(sample1,replace=TRUE)) -
mean(sample(sample2,replace=TRUE))
}
(mean(sample1)-mean(sample2))/sd(x)
Regards,
Erika
[[alternative HTML version deleted]]
2020 Jun 04
2
Preserving destination group and owner
...is something not working as
expected or I'm missing something about owner and group, at least when
I run rsync as root/sudo. Just to get a quick (non-)working example,
when I run this commands (delete files, create two different files,
rsync them) as a non-root user:
sudo rm /tmp/sample1 /tmp/sample2 2> /dev/null
/bin/date > /tmp/sample1
sleep 3
/bin/date > /tmp/sample2
echo "Before rsync:"
ls -l /tmp/sample1 /tmp/sample2
sudo rsync -r --no-o --no-g /tmp/sample1 /tmp/sample2
echo "After rsync:"
ls -l /tmp/sample1 /tmp/sample2
I get this:
Before rsync:
-rw-r--r--...
2010 Sep 07
1
average columns of data frame corresponding to replicates
...d
ids are averaged. For example, in the new data frame, columns 1, 3,
and 5 of the original will be replaced by 1 new column that is the
mean of these three. Thanks for any suggestions.
Juliet
myData <- data.frame("sample1.id1" =rep(1,10),
"sample1.id2"=rep(2,10),
"sample2.id1" = rep(2,10),
"sample1.id3" = 1:10,
"sample3.id1" = rep(1,10),
"sample1.id4" = 1:10,
"sample2.id2" = rep(1,10))
repeat_ids <- c("id1","id2")
2007 May 10
1
how to pass "arguments" to a function within a function?
...s for "FUN" will require different arguments. These arguments will be contained in the column names of "vars". How do I pass these arguments to FUN()?
My example and my attempt:
what I am trying to do, successfully accomplished without a function:
x='sample1'
y='sample2'
sample1=c(222,333,444)
sample2=c(100,200,300)
minus <- function(x,y) {get(x)-get(y)}
minus(x,y)
#########################################################
#My so-far failing attempt to write a function to do the same thing:
vars.in = data.frame(x='sample1',y='sample2')...
2015 Oct 13
1
A where() functions that does what exists() does but return the environment when object lives?
...", inherits=TRUE) retrieves it. I'm looking for a
>> similar function to exists() that returns the environment where the
>> object "foo" exists, iff at all. If not found, NULL is returned.
>> Does that exist?
>>
>> EXAMPLE #1:
>>
>>> sample2 <- base::sample
>>> env <- where("sample2", inherits=TRUE)
>>> env
>>
>> <environment: R_GlobalEnv>
>>
>> Note the difference to:
>>
>>> obj <- get("sample2", inherits=TRUE)
>>> environment(obj)
>...
2018 Jan 24
0
Issue with concatenation of URL losing
...quot;range":false,"shape":[{"lat":10,"lon":20}]}&api_key=mycode
########
On Wed, 24 Jan 2018, Oliver Morris wrote:
> Thank you for your help in advance.
>
>
> I am trying to pull some data back from a web service
>
>
> library(httr)
> sample2 <- GET("https://elevation.mapzen.com/height?json={\"range\":false,\"shape\":[{\"lat\":40.7,\"lon\":-76.5}]}&api_key=mycode")
> result2 <- content(sample2)
> height <- result2$height[[1]]
>
>
> I would like to put by own l...
2010 Nov 04
2
Converting Strings to Variable names
Hi all,
I am processing 24 samples data and combine them in single table called
CombinedSamples using following:
CombinedSamples<-rbind(Sample1,Sample2,Sample3)
Now variables Sample1, Sample2 and Sample3 have many different columns.
To make it more flexible for other samples I'm replacing above code with a
for loop:
#Sample is a string vector containing all 24 sample names
for (k in 1:length(Sample))
{
CombinedSamples<-rbind(get(S...
2015 Oct 13
0
A where() functions that does what exists() does but return the environment when object lives?
Seems easy enough to write yourself:
where <- function(x, env = parent.frame()) {
if (identical(env, emptyenv()))
return(NULL)
if (exists(x, envir = env, inherits = FALSE))
return(env)
where(x, parent.env(env))
}
sample2 <- base::sample
where("sample2")
#> <environment: 0x1154d3c28>
where("sample")
#> <environment: base>
where("blah")
#> NULL
Hadley
On Fri, Oct 9, 2015 at 6:18 PM, Henrik Bengtsson
<henrik.bengtsson at ucsf.edu> wrote:
> Hi,
>
>...
2012 Mar 29
1
Random sample from a data frame where ID column values don't match the values in an ID column in a second data frame
Hello,
Let's say I've drawn a random sample (sample1.df) from a large data frame
(main.df), and I want to create a second random sample (sample2.df) where
the values in its ID column *are not* in the equivalent ID column in the
first sample (sample1.df). How would I go about doing this?
In other words:
The values in sample2.df$ID *are not found* in sample1.df$ID, and both
samples are drawn from main.df.
Thanks in advance,
Matt Dubins...
2009 Sep 16
2
T-test to check equality, unable to interpret the results.
Hi,
I have the precision values of a system on two different data sets.
The snippets of these results are as shown:
sample1: (total 194 samples)
0.6000000238
0.8000000119
0.6000000238
0.2000000030
0.6000000238
...
...
sample2: (total 188 samples)
0.80000001
0.20000000
0.80000001
0.00000000
0.80000001
0.40000001
...
...
I want to check if these results are statistically significant? Intuitively,
the similarity in the two results mean the results are statistically
significant.
I am using the t-test t.test(sample1,sample2...
2012 Jul 31
2
phantom NA/NaN/Inf in foreign function call (or something altogether different?)
...le1.lrm1 = lrm(Target.ACC ~ (L1 + Relation + Target.RESP)^2, sample1, x=T, y=T)
> sample1.lrm2 = lrm(Target.ACC ~ (L1 + Relation + Word.Order)^2, sample1, x=T, y=T)
When running the problematic analysis on a smaller sample of the same
data, I get a different (more precise?) error message:
> sample2 <- sample1[1:500,]
> sample2.lrm = lrm(Target.ACC ~ (Target.RESP + Word.Order)^2, sample2, x=T, y=T)
Error in fitter(X, Y, penalty.matrix = penalty.matrix, tol = tol,
weights = weights, :
NA/NaN/Inf in foreign function call (arg 1)
But I cannot find any NA in the data:
> table(complete...
2008 May 21
2
Problem in converting natural numbers to bits and others
Hi,
I just started using R for about one week and I have few problems.
i)I have a problem in finding right function to convert a table of natural
numbers to bitwise. For a simple example;
I have the below table:-
Column Col1 Col2 Col3
Sample1 5 7 10
Sample2 0 2 1
Sample3 4 0 0
Supposedly i wanted to convert to :-
Column Col1 Col2 Col3
Sample1 1 1 1
Sample2 0 1 1
Sample3 1 0 0
ii)Besides, I would like to create a formula of Sum(3*(Element in each
column for a row))..does it eq...