Displaying 20 results from an estimated 22 matches for "dat5".
Did you mean:
dat
2012 Jul 29
1
readRDS, In as.double.xts(fishReport$count) : NAs introduced by coercion
Hello,
I looked in the R-help but could not find an archive addressing the
following. I would like to convert a character to numeric after reading a
file with RDS extension. After using as.numeric, I checked if it is
numeric. It was not converted. Please help.
Here is my code
>Report <- readRDS(file="RDS/Report.RDS")
> Report[1:2,]
dive_id date
2012 Mar 10
3
function input as variable name (deparse/quote/paste) ??
Hi all
Say I have a function:
myname=function(dat,x=5,y=6){
res<<-x+y-dat
}
for various input such as
myname(dat1)
myname(dat2)
myname(dat3)
myname(dat4)
myname(dat5)
how should I modify the 'res' line, to have new informative variable name
correspondingly, such as
dat1.res
dat2.res
dat3.res
dat4.res
dat5.res
stored in the workspace.
This is only an example of a complex function I have written.
Thanks in advance!
Casper
--
View this message in...
2012 Nov 01
2
Subsetting year range
Hi,
I have a panel data set that I am trying to subset. I am trying to keep
values for years >=1960.
The full set is from 1940 to 2000.
I tried a few things, but none worked. Here are a couple that I am trying to
use.
TableAPS1 <- subset(TableAP, year => 1959)
TableAPS1 <- TableAP[ which(year > 1959),]
It would be really nice if someone can point out what I am doing wrong
2012 Jul 14
2
Arrange two columns into a five variable dataframe
Hi,
I hope that folks can give me some simple approaches to taking the data set
below, which is accumulated in two columns called "long" and "group", then
arrange the data is the "long" column into a data frame containing five
variables: "Group 1", "Group 2", "Group 3", "Group 4", and "Group 5". I am
hoping for a few
2011 Jul 02
5
How many times occurs
...table('input1.txt')*
**
**
*dat1 <- dat[ dat[,1]=8 & dat[,2]=9 & dat[,3]=2 ,]=1*
*dat2<-dat[(dat[,2]= 8 & dat[,3]=9 & dat[,4]=2),]=1*
*dat3<-dat[(dat[,5]=8 & dat[,4]=9 & dat[,5]=2),]=1*
*dat4<-dat[(dat[,4]=8 & dat[,5]=9 & dat[,6]=2),]=1*
*dat5<-dat[(dat[,5]=8 & dat[,6]=9 & dat[,7]=2),]=1*
*dat6<-dat[(dat[,6]=8 & dat[,7]=9 & dat[,8]=2),6]=1*
*dat7<-dat[(dat[,7]=8 & dat[,8]=9 & dat[,9]=2),7]=1*
*dat8<-dat[(dat[,8]=8 & dat[,9]=9 & dat[,10]=2),8]=1*
**
datfinal<-dat1+da2+dat3+dat4+da...
2012 Jul 14
2
Help for Fisher's exact test
Hi, R-help,
I have a group of data from RNA-seq want to be analyzed by Fisher's
exact test in R. I want to compare the significant difference of about
30,0000 individuals in two different samples, and I have no idea how to use
R, so could you please give me some suggestions or the scripts for
Fisher's exact test? Thank you very much.
Best,
Guanfeng Wang
[[alternative HTML version
2012 Oct 04
3
R combining vectors into a data frame but without a continuous common variable
Hello,
I have two different files which I'd like to combine to make one data frame
but I've no idea how to do it! The first file has two columns; one is the
date, the following is a binary code for debris flow events. Then my other
file has also two columns; the date and then precipitation data.
The thing is, is that the two date columns don't all contain the same dates.
The binary
2012 Jun 06
1
error calling Winbugs using R2WinBugs to run a multi-level model
...one).
The model loops over the path of each animal, estimating a hidden
movement state and their parameters. For 4 individuals with 100 data
points each the data looks something like this:
dat1 : num 100
dat2 : int 4
dat3 : num [1:4] 8 4 2 5
dat4 : num [1:100, 1:4] 1 1 1 1 1 2 2 2 2 2 ...
dat5 : num [1:100, 1:4] 2 2 2 2 2 1 2 2 2 2 ...
dat6 : num [1:100, 1:4] 16 34.3 33.5 27.9 14.9 ...
dat7 : num [1:100, 1:4] 0.357 0.474 0.487 0.495 0.524 ...
dat8 : num [1:50, 1:4] 36.4 294.5 24.4 21.1 422.8 ...
This is how I've called WinBugs in r:
# write data to text file
sp.data =...
2012 Oct 26
3
regression analysis in R
Dear useRs,
i have vectors of about 27 descriptors, each having 703 elements. what i want to do is the following 1. i want to do regression analysis of these 27 vectors individually, against a dependent vector, say B, having same number of elements.2. i would like to know best 10 regression results, if i do regression analysis of dependent vector against the random combination of any 4
2011 Nov 27
1
Simplifying my code
Hi,
I have a pretty simple problem. Here is the code:
dat1=complete(dat.mice,1)
dat2=complete(dat.mice,2)
dat3=complete(dat.mice,3)
dat4=complete(dat.mice,4)
dat5=complete(dat.mice,5)
dat6=complete(dat.mice,6)
dat7=complete(dat.mice,7)
dat8=complete(dat.mice,8)
dat9=complete(dat.mice,9)
dat10=complete(dat.mice,10)
dat11=complete(dat.mice,11)
dat12=complete(dat.mice,12)
dat13=complete(dat.mice,13)
dat14=complete(dat.mice,14)
dat15=complete(dat.mice,...
2013 Sep 09
0
Duplicated genes
...- sum(apply(x[,6:32],2,function(y) y[1]>=y[2]));x2<- sum(apply(x[,6:32],2, function(y) y[1]<=y[2])); if(x1>x2) x[1,] else x[2,] } ),unique(dat2$gene)) #assuming that there are not more than 2 copies of a particular gene. (In the dataset, it was not present)
?dat4<-rbind(dat1New,dat3)
dat5<-dat4[order(as.numeric(row.names(dat4))),]
?dim(dat5)
#[1] 639? 32
A.K.
________________________________
From: Vivek Das <vd4mmind at gmail.com>
To: arun <smartpink111 at yahoo.com>
Sent: Monday, September 9, 2013 2:30 PM
Subject: Re: Duplicated genes
actually these are all di...
2001 Mar 12
2
RODBC problems
Hi all.
I'm trying to see how the package Rodbc works, with R 1.2.2, win98 and MySql 3.23.
I'd like to export a dataset with 524 variables and 3440 records form R to MySql. I issued the following commands:
library(RODBC)
channel <- odbcConnect("test")
sqlSave(channel,dat=totale)
Error in sqlTables(channel)[, 3] : incorrect number of dimensions
Actually it gave me other
2012 Aug 01
4
apply function over same column of all objects in a list
Hello. Please forgive me if this problem has already been posted (and solved)
by someone else ... I can't find it anywhere though it seems so very basic.
Here it is:
I have a list comprised of several matrices, each of which has two columns.
> list
[[1]]
[,1] [,2]
[1,] 1 3
[2,] 2 4
[[2]]
[,1] [,2]
[1,] 5 7
[2,] 6 8
[[3]]
[,1] [,2]
2012 Nov 19
6
How to subset my data and at the same time keep the balance?
Hi guys,
I have 1000 rows of a dataset. In my analysis, I need 70% of the data,
run my analysis and then use the remaining 30% to test my model.
Could anybody kindly help me on this?
Cheers
2012 Oct 12
3
Columns and rows
Hi,
Could you please advice some easy way to do the following for a dataframe
(header=F) having unequal column- & row- length.
1. Combine/stack/join contents from -
a) multiple rows into one column.
b) multiple columns into one row.
2. Stack contents from multiple columns (or, rows) into one column (or,
row).
Thank you.
Cheers,
Santana
[[alternative HTML
2012 Jul 24
5
First value in a row
Hi.
This is likely a trivial problem but have not found a solution.
Imagine the following dataframe:
Lat Lon x1 x2 x3
01 10 NA NA .1
01 11 NA .2 .3
01 12 .4 .5 .6
I want to generate another column that consist of the first value in
each row from columns x1 to x3. That is
NewColumn
.1
.2
.4
Any input greatly appreciated,
Thanks,
Camilo
Camilo Mora, Ph.D.
2012 Jun 28
6
How can I make a list using aggregate function?
Hi friends,
I need to generate a list, that should contain the quantile value of one
column in a data frame. while I am compiling this one i am facing one bug,,
Really I cannot find out that where the problem has occurred? Could any one
help me to come out from this bug??
Here is the code,
data <- lapply(comb.data$zFE, function(x) aggregate(x,
2012 Nov 07
8
Aggregate data frame across columns
Folks,
I have a data frame with columns 200401, 200402, ..., 201207, 201208.
These represent years/months. What would be the best way to sum these columns by year? What about by quarter?
Thanks for your time,
KW
--
[[alternative HTML version deleted]]
2012 Oct 12
3
average duplicated rows?
Dear useRs,
I have a slightly complicated data structure and am stuck trying to extract what I need. I'm pasting an example of this data below. In some cases, there are duplicates in the "gene_id" column because there are two different "sample 1" values for a given "sample 2" value. Where these duplicates exist, I need to average the corresponding
2014 Sep 01
1
Correlation Matrix with a Covariate
...y other variables concurrently.
I'm using the "psych" package and have tried other methods such as writing
a loop to extract semi-partial correlations, but it does not seem to be
working. How can I accomplish this?
library(psych)
> set.cor(y = (66:76), x = c(1:64), z = 65, data = dat5)
Error in solve.default(x.matrix, xy.matrix) :
Lapack routine dgesv: system is exactly singular: U[54,54] = 0
structure(list(cope8_StriatumMask_7_betas_mean = c(11.47, -0.6002,
-11.59, -52.51, 36.63, -36.99, -26.89, 21.68, 3.776, 19.35, -56.44,
-11.41, -1.825, 5.327, -2.886, 11.91, 43.99, 42.17,...