Displaying 20 results from an estimated 10000 matches similar to: "number of pairwise present data in matrix with missings"
2009 Aug 12
2
Symbolic references - passing variable names into functions
Hello All,
I am trying to write a function which would operate on columns of a
dataframe specified in parameters passed to that function.
f = function(dataf, col1 = "column1", col2 = "column2") {
dataf$col1 = dataf$col2 # just as an example
}
The above, of course, does not work as intended. In some languages one
can force evaluation of a variable, and then
2007 Oct 19
1
conduct pairwise column comparisons without comparing a column to itself
# Hello
# I have a question regarding pairwise calculations of a matrix using a
"for-loop."
# Below I have a matrix "X" with 8 columns. These are genotypic data so
Column1 & Column2 is
# a unit, Column3 & Column4 is a unit, Column5 & Column6 is a unit, and
Coulmn7 & 8 is a unit.
# I have a loop designed to calculate the number of times an individual in
2011 Apr 13
2
setting pairwise comparisons of columns
Hi,
I have a number of genes (columns) for which I want to examine pairwise
associations of genotypes (each row is an individual)...For example (see
data below), I would like to compare M1 to M2, M2 to M3, and M1 to M3 (i.e.
does ac from M1 tend to be found with bc from M2 more often than expected.)
Down stream I will be performing chi square tests for each pair.
But I am looking for a way to
2012 Jun 12
4
How to index a matrix with different row-number for each column?
here's my question: suppose I have a matrix:
mt<-matrix(1:12,ncol=6)
now I have a vector
vt<-c(1,2,2,2,1,2)
which means I want to get:
the 1st row for column1;
the 2nd row for column2;
the 2nd row for column3;
the 2nd row for column4;
...
that what I want is this vector:
1,4,6,8,9,12
Does anyone know how to do this fast?
I know I can use for-loop to travel all columns,but
2006 Aug 08
3
Pairwise n for large correlation tables?
Hello,
I'm using a very large data set (n > 100,000 for 7 columns), for which I'm
pretty happy dealing with pairwise-deleted correlations to populate my
correlation table. E.g.,
a <- cor(cbind(col1, col2, col3),use="pairwise.complete.obs")
...however, I am interested in the number of cases used to compute each
cell of the correlation table. I am unable to find such a
2009 Aug 03
2
Some SQL Challenges
Hi,
Im trying to complete a list of jobs using SQL Querries and some "if else"
commands but im stucked in some steps. Could any of you give me some help?
-in COLUMN1 change the format 20JAN2000:00:00:00 to 20JAN2000 and exclude
every row that date is different from 20.
-extract the first character in COLUMN2 and creat COLUMN3 with that value
ex:
COL2,COL3
135,1
461,4
247,2
-in every
2024 Jun 06
2
R Shiny Help - Trouble passing user input columns to emmeans after ANOVA analysis
Hello everybody,
I have experience coding with R, but am brand new to R Shiny. I am trying
to produce an application that will allow users to upload their own
dataset, select columns they want an ANOVA analysis run on, and generate
graphs that will allow users to view their results. However, I am getting
the following error: *"Argument is of length zero."*
Being new to Shiny, I am
2005 May 02
4
"apply" question
Dear R users,
I??ve got a simple question but somehow I can??t find the solution:
I have a data frame with columns 1-5 containing one set of integer
values, and columns 6-10 containing another set of integer values.
Columns 6-10 contain NA??s at some places.
I now want to calculate
(1) the number of values in each row of columns 6-10 that were NA??s
(2) the sum of all values on columns 1-5
2010 May 31
2
accessing a data frame with row names
Readers,
I have entered a file into r:
,column1,column2
row1,0.1,0.2
row2,0.3,0.4
using the command:
dataframe<-read.table("/path/to/file.csv",header=T,row.names=1)
When I try the command:
dataframe[,2]
I receive the response:
NULL
I was expecting:
row1 0.2
row2 0.4
What is my error with the syntax please?
Yours,
r251
mandriva2009
2009 Nov 26
3
barchart() {Lattice} help.
Hi R Users,
I'm trying to plot a stacked barplot. Here is data:
Sample Col1 Col2 Col3
Row1 -2 4 -1
Row2 3 -2 4
Row3 3 5 -2
Row4 4 1 -1
I'm using following R code:
library(lattice)
dta<-read.table("data.txt", header=TRUE, row.names="Sample")
barchart(data.matrix(dta),
horizontal=FALSE,
stack=TRUE,
col=2:4,
2009 May 14
2
Function to read a string as the variables as opposed to taking the string name as the variable
I am writing a custom function that uses an R-function from the
reshape package: cast. However, my question could be applicable to
any R function.
Normally one writes the arguments directly into a function, e.g.:
result=cast(table1, column1 + column2 + column3 ~ column4,
mean) (1)
I need to be able to write this statement as follows:
result=cast(table1, string_with_columns ~
2008 Feb 26
1
Split data.frames depeding values of a column
Hello to all
is there a function wich splits a data.frame (column1,column2,column3,....)
into
data1 <-(column1,column3....) #column2 = 1
data2 <-(column1,column3....) #column2 = 2
data3 <-(column1,column3....) #column2 = 3
...
Regards Knut
2006 Jun 07
4
Question: coding protected methods
Apologies first, because I need to ramp up on Ruby and coding Ruby in Rails,
however it''s my 3rd day with this beast :) so I''m asking :
When I added protected methods to the model before it was like:
protected
method....................
end
Would this be a valid way to write a protected method as well ?:
attr_protected :column1, :column2
Perhaps this particular call
2009 Jun 17
6
script help
Hi
?
I have a file. list.txt (two columns)
?
column1??? column2
name??????? address
?
?
I need to put in the letter file letter.txt eg:
?
Dear: Chloe
Address: CA
?
Can I use this
?
for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
?
Thank you for your help
?
?
?
?
?
__________________________________________________________________
Looking for the perfect gift?
2009 Jun 15
2
Help with syntax error
Hi,
I have written boxplot commands of this form before, but I don''t quite understand why the function call is reporting a syntax error in this instance. All parameters passed to the function are strings.
Thanks in advance.
Payam
> simplevar <- function(wframe,column1,column2) {
+ tframe <- get(wframe)
+ x1 <- which(names(wframe)==column1)
+ x2 <-
2024 Dec 12
1
Cores hang when calling mcapply
Hi Gregg.
Just wanted to follow up on the solution you proposed.
I had to make some adjustments to get exactly what I wanted, but it works, and takes about 15 minutes on our server configuration:
temp <-
??????open_dataset(
????????????sources = input_files,
????????????format = 'csv',
????????????unify_schema = TRUE,
????????????col_types = schema(
????????????"ID_Key"
2024 Dec 11
1
Cores hang when calling mcapply
Hello Thomas,
Consider that the primary bottleneck may be tied to memory usage and the complexity of pivoting extremely large datasets into wide formats with tens of thousands of unique values per column. Extremely large expansions of columns inherently stress both memory and CPU, and splitting into 110k separate data frames before pivoting and combining them again is likely causing resource
2013 Mar 21
2
Displaying median value over the horizontal(median)line in the boxplot
Hi,
set.seed(45)
test1<-data.frame(columnA=rnorm(7,45),columnB=rnorm(7,10)) #used an example probably similar to your actual data
apply(test1,2,function(x) sprintf("%.1f",median(x)))
#columnA columnB
# "44.5"? "10.2"
par(mfrow=c(1,2))
lapply(test1,function(x) {b<-
2004 Oct 25
2
Reading sections of data files based on pattern matching
I am about to write general functions to read the output of simulations
models.
These model generate output files with different sections which I want
to analyze plot etc.
Since this will be used many people at the department I wanted to make
sure that will do this in the best way.
For instance I want to read a snippets of data from a text that look
like this.
2024 Dec 11
1
Cores hang when calling mcapply
How is the server configured to handle memory distribution for individual users. I see it has over 700GB of total system memory, but how much can be assigned it each individual user?
AAgain - just curious, and wondering how much memory was assigned to your instance when you were running R.
regards,
Gregg
On Wednesday, December 11th, 2024 at 9:49 AM, Deramus, Thomas Patrick <tderamus at