Displaying 20 results from an estimated 20000 matches similar to: "t.test in for loop"
2008 Sep 03
1
Read from many files into many object
Dear all,
I am new in R. I want to read data which is vector from many files and
import to many object.
For example I have 10(ten) files.
file1.txt
file2.txt
:
:
file10.txt.
I want to import each file into one object as follows.
data1
data2
:
:
data10
I want to import file1.txt into data1, file2.txt into data2, and so on.
How to do it quickly?
Thanks in advance.
Sigit B. Wibowo
2010 Sep 06
1
combining collumns for data.frames
Hi
This question is far less simple than the title suggests, please read carefully, thanks.
I have 2 sets of data, both read into R
>data1<-read.table ("1.txt", header=T, sep="\t")
>data2<-read.table ("2.txt", header=T, sep="\t")
>data1
Taxon stage1 stage2 stage3 stage4
T1 0 0 1 1
T2 0
2009 Nov 06
1
probem on merge data
Hi there,
data1<-matrix(data=c(1,1.2,1.3,"3/23/2004",1,1.5,2.3,"3/22/2004",2,0.2,3.3,"4/23/2004",3,1.5,1.3,"5/22/2004"),nrow=4,ncol=4,byrow=TRUE)
data1<-data.frame(data1)
names(data1)<-c("areaid","x","y","date")
data1
areaid x y date
1 1 1.2 1.3 3/23/2004
2 1 1.5 2.3 3/22/2004
3 2
2011 Nov 16
3
plotting a double y axis when x and y lengths differ
Hello All,
Many thanks to the help I have received so far.
Here is an example data set I hope to plot
Data1
Year Data SE
1 2005 2 0.01
2 2006 4 0.01
3 2007 5 0.01
4 2008 2 0.01
5 2009 3 0.01
6 2010 6 0.01
Data2
Year Data SE
1 2006 32 1
2 2007 100 2
3 2008 60 4
4 2009 67 3
5 2010 8 1
Notice Data2 has one less years worth of data than Data1 (which is my
2009 Nov 13
2
why the same values cannot be judged to be the same in R
Hi Rusers,
I found sometimes that the same values cannot be judged to be the same in
R. Anybody knows the probelm? I think i ignored some minor detail. Thanks.
Here is the example.
############
data1<-matrix(data=c(1,1.2,1.3,"3/23/2004",1,1.5,2.3,"3/22/2004",2,0.2,3.3,"4/23/2004",3,1.5,1.3,"5/22/2004"),nrow=4,ncol=4,byrow=TRUE)
2008 Nov 04
1
fuse_setlk_cbk error
I'm building a two node cluster to run vserver systems on. I've setup
glusterfs with this config:
# node a
volume data-posix
type storage/posix
option directory /export/cluster
end-volume
volume data1
type features/posix-locks
subvolumes data-posix
end-volume
volume data2
type protocol/client
option transport-type tcp/client
option remote-host
2002 Dec 05
1
Passing options as lists
Hi,
I apologize if this has previously been posted. I've just subscribed to the
R-help digest.
I'm writing a plotting function that uses layout() to plot several different
plots on the same device. This function uses plot(), image(), and a custom
function that uses text(). Each cell of the layout needs different par()
parameters, so what I'd like to do is pass them as lists:
2008 Aug 21
1
problem merging two data sets ( one with a header and one without)
I have two set of data, Data1 and Data2 . Data1 has a header and Data2 does
not. I would like to merge the two data sets after removing some columns
from data2 .
I am having a problem merging so I had to write and read final data and
specify the ?header=F? so the merge can be done by?V1?. Is there a way to
avoid this step. The problem is when I do cbind the FinalData has different
column names
2011 Oct 07
2
Merge dataframes
Hello,
I am having some problems to use the 'merge' function. I'm not sure if I got
its working right.
What I want to do is:
1) Suppose I have a dataframe like:
height width
1 1.1 2.3
2 2.1 2.5
3 1.8 1.9
4 1.6 2.1
5 1.8 2.4
2) And I generate a second
2010 May 28
1
Match 2 vectors
Hi,
I have 2 dataframes of unequal length, and I would like to match a
factor to them so that both dataframes will have the same number of
rows.
example:
# create the 2 dataframes with unequal length
data1 <- data.frame(letters, 1:26)[-c(5,10,19:21),]
data2 <- data.frame(letters, 1:26)[-c(6,9,15:18),]
data2a <- match(data1[,1], data2[,1])
data2b <- data2[data2a,]
When I match
2012 May 27
3
Problem with strptime
Hello Forum,
I have a problem with the strptime function. With the ''data1'' dataset below
it works fine, but with the ''data2'' dataset something goes wrong (see final
line below). Both data1 and data2 are in exactly the same original format,
the only difference is that they span different dates. Please help, since it
is driving me nuts! Many thanks.
Best
2006 May 30
3
Faster way to zero-pad a data frame...?
Hello List,
I am working on creating periodograms from IP network traffic logs using the Fast Fourier Transform. The FFT requires all the data points to be evenly-spaced in the time domain (constant delta-T), so I have a step where I zero-pad the data.
Lately I've been wondering if there is a faster way to do this. Here's what I've got:
* data1 is a data frame consisting of
2011 May 08
3
%in% operator - NOT IN
Hello everyone,
I am attempting to use the %in% operator with the ! to produce a NOT IN type
of operation. Why does this not work? Suggestions?
> data2[data1$char1 %in% c("string1","string2"),1]<-min(data1$x1)
> data2[data1$char1 ! %in% c("string1","string2"),1]<-max(data1$x1)+1000
Error: unexpected '!' in "data2[data1$char1
2006 Dec 15
2
ks.test "greater" and "less"
Hello r-group
I have a question to the ks.test.
I would expect different values for less and greater between data1 and
data2.
Does anybody could explain my point of misunderstanding the function?
data1<-c(8,12,43,70)
data2<- c(70,43,12,8)
ks.test(data1,"pnorm")
ks.test(data1,"pnorm",alternative ="less") #expected < 0.001
2009 May 24
2
Assigning variable names from one object to another object
Hello
I have 2 datasets say Data1 and Data2 both are of different dimesions.
Data1:
120 rows and 6 columns (Varname, Vartype, Labels, Description, ....)
The column Varname has 120 rows which has variable names such id, age,
gender,.....so on
Data2:
12528 rows and 120 columns
The column names in this case are V1, V2, ......... V120 (which are default
names in R when we say head=F in read.csv)
2008 May 14
4
Accessing items in a list of lists
Using R 2.6.2, say I have the following list of lists, "comb":
data1 <- list(a = 1, b = 2, c = 3)
data2 <- list(a = 4, b = 5, c = 6)
data3 <- list(a = 3, b = 6, c = 9)
comb <- list(data1 = data1, data2 = data2, data3 = data3)
So that all names for the lowest level list are common. How can I most
efficiently access all of the sublist items "a" indexed by the outer
2008 Oct 08
1
Lattice question: plotting two sets of data, defining groups for the second set
R friends,
I'm running R 2.7.2 on Windows XP SP2.
I have some data that's amenable to smoothing, and some that's not. I'm
trying to plot smoothed lines for the former along with just points for the
latter in a single panel. The problem comes when trying to break out the
points by group. My sample code follows.
data1 <-
2019 Mar 28
2
NFSv4: Using fsid=0 but *not* exporting the root filesystem
Hi,
I would like to use the NFSv4 ability to create a "root" filesystem with
fsid=0, so that I don't have to refer to the whole path of the exported
filesystem when I mount it. However I do *not* want this root
filesystem to be mountable by any host. Is that possible and how?
E.g
Filesystem:
/exports/data1
/exports/data2
/exports/data3
/etc/exports:
/exports
2006 Nov 24
1
barplot help needed
hello,
I would like to create the following barplot:
I have 4 different data sets (same length + stddev for each data point)
data1
sd1
data2
sd2
data3
sd3
data4
sd4
now, I'd like to plot in the following way:
data1[1],data2[1],data3[1],data4[1] with it's sd-values side-by-side at
one x-axis label (named "position 1") and each bar in different colors.
2013 Jan 16
1
function approx interpolation of time series data sets
Readers,
Am trying to use the function 'approx' to interpolate time series data sets:
data1:
01:23:40 5
01:23:45 10
01:23:50 12
01:23:55 7
data2:
01:23:42
01:23:47
01:23:51
01:23:54
The objective is to obtain interpolated values of 'data1' column 2 (5,
10, 12, 7) for the times shown in data2. Tried the following command
but received the error shown: