Displaying 20 results from an estimated 79 matches for "rawdata".
2002 Dec 18
6
Can I build an array of regrssion model?
...,
I am trying to use piecewise linear regression to approximate a
nonlinear function. Actually, I don't know how many linear functions I
need, therefore, I want build an array of regression models to automate
the approximation job. Could you please give me any clue?
Attached is ongoing code:
rawData = scan("c:/zyang/mass/data/A01/1.PRN",
what=list(numeric(),numeric()));
len = length(rawData[[1]]);
cuts = len*c(0.01, 0.03, 0.08, 0.18, 0.38, 0.69, 1);
cuts = as.integer(cuts);
mod1 = lm(rawData[[2]][1:cuts[1]]~rawData[[1]][1:cuts[1]]);
mod2 =
lm(rawData[[2]][cuts[1]:cuts[2]]~rawData[[...
2011 May 17
1
simprof test using jaccard distance
...999, method.cluster = "average",
method.distance = "euclidean", method.transform = "identity",
alpha = 0.05, sample.orientation = "row", const = 0, silent = TRUE,
increment = 100)
{
if (!is.matrix(data))
data <- as.matrix(data)
rawdata <- data
if (sample.orientation == "column")
rawdata <- t(rawdata)
if (is.function(method.distance))
rawdata.dist <- method.distance(rawdata)
else if (method.distance == "braycurtis") {
rawdata.dist <- braycurtis(rawdata, const)...
2012 Dec 10
1
Can somebody suggest how to achieve following data manipulation?
Dear all,
Let say I have following data:
RawData <- matrix(1:101, nr = 1); colnames(RawData) <- c("ASD",
as.character(as.yearmon(seq(as.Date("2012-03-01"), length.out = 100, by
= "1 month")))); rownames(RawData) <- "XYZ"
CutOffDate <- as.Date("2012-09-01")
NewDateSeries <- as.ch...
2008 Mar 23
1
mapply
In an earlier post, a person wanted to divide each of the rows of
rawdata by the row vector sens so he did below but didn't like it and
asked if there was a better solution.
rawdata <- data.frame(rbind(c(1,2,2), c(4,5,6))) sens <- c(2,4,6)
temp <- t(rawdata)/sens
temp <- t(temp)
print(temp)
Gabor sent three other solutions and I understood...
2005 Aug 04
2
Avoiding for loop
...o. So the first row in the data snippet above
means that the first row of my matrix needs to have a 1 in the 1st
column, and a -1 in the 55nd column. (And 0 elsewhere, which is
already there as I've created the matrix filled with 0s beforehand.)
So my current code looks like:
if(nrow(rawdata) >= 1) for(i in 1:nrow(rawdata)) {
X[i, rawdata[i, 1]] <- 1
X[i, rawdata[i, 2]] <- -1
}
where rawdata is the original data file.
This sort of assignment happens many times in my program so any
improvement would be much appre...
2009 Jul 14
2
How to provide list as an argument for the data.frame()
Hi R -users,
i've a table as describe below. I'm reading the numeric value presented in this table to populate a list.
#table
#============
#X A B C
#x1 2 3 4
#x2 5 7 10
#x4 2 3 5
#============
rawData <- read.table("raw_data.txt",header=T, sep="\t")
myList=list()
counter=0
for (i in c(1:length(rawData$X)))
{
print (i)
myList[counter <- counter +1]=as.numeric(rawData$A[i]);
myList[counter <- counter +1]=as.numeric(rawData$B[i]);
myList[counter <- co...
2011 Sep 08
2
pie chart
Hi All,
I have txt file like :
$ cat data.txt
US 10
UK 12
Ind 4
Germany 14
France 8
> rawdata <- read.table(file='data.txt',sep='\t' , header=FALSE)
> rawdata
V1 V2
1 US 10
2 UK 12
3 Ind 4
4 Germany 14
5 France 8
I want to draw pie chart for the above data.
How to split rawdata into :
con <- c("US","UK","Ind"...
2006 Jul 12
4
Keep value lables with data frame manipulation
Dear R,
I import data from spss into a R data.frame. On this rawdata I do some
data processing (selection of observations, normalization, recoding of
variables etc..). The result is stored in a new data.frame, however, in
this new data.frame the value labels are lost.
Example of what I do in code:
# read raw data from spss
rawdata <- read.spss("./data/T509...
2012 Jan 20
2
rbind()
Hello there,
Much thanks in advance for any help. I have a few questions:
1) Why do I keep getting the following error:
File1 <- read.csv("../RawData/File1.csv",as.is=TRUE,row.names=1)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file '../RawData/File1.csv': No such file or directory
?
More specifically, my directories are set up in the...
2008 Mar 22
2
More elegant multiplication or division of a data frame with a vector
Hello,
I am importing some raw voltage multichannel measurements into an R
data frame. I need to scale each column with the respective
sensitivity for that channel. I figured how to do it, but I am curious
if there isn't a more elegant way.
Now I start with something like this:
rawdata <- data.frame(rbind(c(1,2,3), c(4,5,6)))
sens <- c(2,4,6)
and I do this:
data <- as.data.frame(t(t(rawdata)/sens))
Any suggestions?
Cheers,
TL
2009 Aug 03
2
Scale set of 0 values returns NAN??
...iments are
constructed. (That's a very "Good Thing")
So, on to the question...
I'm scaling data based on groups. I have it working well in a nice
loop. (This WORKS, but if someone has a faster/cleaner way, I'd be
curious.)
#group-wide normailzation
groups <- unique(rawdata$group)
group_names = grep('norm_',names(rawdata))
for(group in groups){
for(name in group_names){
rawdata[rawdata$code==group, name] <-
c(scale(rawdata[rawdata$code==group, name]))
}
}
My problem is that if the particular list of data I'm scoring is all 0,
then...
2009 Sep 28
1
help with lda function
...)<-c("y","x1","x2")
d$x1 = d$x1 * 100
d$x2 = d$x2 * 100
g<-lda( y ~ x1 + x2, data=d)
v2 <- predict(g, d)",
I get;
LD1
1 -2.3769280
2 -2.7049437
3 -3.4748309
4 -0.9599825
5 4.2293774
6 2.6052193
7 2.6820884
However, If I do it manually,
"rawdata<-matrix(scan("tab1_1.
>
> dat"),ncol=3,byrow=T)
> group <- rawdata[,1]
> X <- 100 * rawdata[,2:3]
> Apf <- X[group==1,]
> Af <- X[group==0,]
> xbar1 <- apply(Af, 2, mean)
> S1 <- var(Af)
> N1 <- dim(Af)[1]
> xbar2 <- apply(Apf, 2, m...
2009 Jun 16
1
adressing dataframes
Hi everyone,
I experience some problems with adressing of data.frames when I retrieve
some information for geographical position (ypos, xpos) ot of a MySQL
Database and want to perform some simple statistics. The problem is
adressing the dataframes with a construct like
rawdata[c(type)] vs. rawdata$TEMPMIN
to retrieve the numerical information and not a string (I want to store the
numerical values in a database for graphical expression)
Code Snippet:
type <- "TEMPMIN"
numbers <-summary(rawdata[c(type)])
numbers2 <- summary(rawdata$TEMPMINIMUM)...
2012 Jun 28
1
Merging listed dataset into one
Hello,
I'm wondering how I can merge two featuresets into one.
My dataset is two sets of microarray data and it looks like followings:
> rawData
$v1
TilingFeatureSet (storageMode: lockedEnvironment)
assayData: 2197815 features, 59 samples
element names: channel1, channel2
protocolData
rowNames: LT290677RU_D1_2011-02-16 LT286300LU_D1_2010-07-24 ...
LT003990RU_D1_2010-11-04 (59 total)
varLabels: filenamesChannel1 filenamesChannel2...
2012 Mar 20
3
Wrong output due to what I think might be a data type issue (zoo read in problem)
...I apologize for the length of the data. I tried to cut it down to 12 lines,
however, it wasn't reproducing the bad output that I wanted to show.
The problem is that my whole data set shifts down. For example, I have this
when the raw data is read in or scanned in as a zoo object:
"> rawData
(12/01/10 00:53:00) (12/01/10 01:53:00) (12/01/10 02:53:00) (12/01/10
03:53:00)
41 40 39
38
(12/01/10 04:53:00) (12/01/10 05:53:00) (12/01/10 06:53:00) (12/01/10
07:53:00)
38 37...
2009 Jul 31
1
scale subset of data
Hi,
This should be an easy one, but I have some trouble formatting the data
right
I'm trying to replace the column of a subset of a dataframe with the
scaled data for that column of the subset
subset(rawdata, code== "foo", select = a) <- scale( subset(rawdata,
code== "foo", select = a) )
It returns: could not find function "subset<-"
The scale command works individually and the subset command works
individually.
Can someone help me format this command line cor...
2009 Sep 20
1
Return a list from a .Call but segfaults
...shared library symbols:
Cannot find new threads: generic error
Cannot find new threads: generic error]
and cannot proceed.
==== Code ====
SEXP returnListOfKV(SEXP raw,SEXP numread){
if(TYPEOF(raw)!=RAWSXP){
return(R_NilValue);
}
int num = INTEGER(numread)[0];
char *rawdata = (char*)RAW(raw);
SEXP KV ,rval;
int r;
PROTECT(rval = Rf_allocVector(VECSXP, num));
for(int i=0;i<num;i++){
SEXP k = R_NilValue;
PROTECT(KV = Rf_allocVector(VECSXP, 2));
r = reverseUInt(*((int*) rawdata)); //converts network order to
host
rawd...
2009 Jul 31
2
concatenating multiple columns from files
R-users,
I want to concatenate columns from different files in a single object.
I'm doing bad. My peace of code is as follow:
rawdata <- list.files("./data")
for (i in rawdata) {
mat[ ] <- read.table(paste(i ,sep=""))
}
At the end of the loop I have just one column. What I'm doing wrong?
Thanks,
Fred
--
View this message in context: http://www.nabble.com/concatenating-multiple-columns-from-file...
2008 Oct 24
7
combining data from different datasets
...lamic Republic of
4 NA AG ATG 28 Antigua and Barbuda
5 NA AI AIA 660 Anguilla
159 AF NA NAM 516 Namibia, Republic of
...
246 AF ZW ZWE 716 Zimbabwe, Republic of
and
> rawdata
idno alter sex cctld capacity topics content speakers
1 1 NA M AD A 2 1 2
2 2 52 M <NA> A 3 2 2
3 3 39 F NA T 2 2 2
...
How do I make it print out something like
alter sex c...
2001 Jan 11
4
read data into R with some constraints
...7, -1, 34, 65
120, 15, 0, 25
113, 0, -1, 32
142, -1, -1, 55
.....
I want to read only those records having positive
values in all of the four
columns. That is, I don't want to read record # 3, 5,
and 6 into R. However,
when I type:
read.csv("data.csv", sep=",") -> rawdata
it reads the whole thing into R including those
records I don't want.
Could anyone tell me how I can read only those records
I want?
Thanks,
Yu-Ling Wu
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.c...