similar to: question about read.columns

Displaying 20 results from an estimated 700 matches similar to: "question about read.columns"

2010 Sep 24
1
How to read this file into R.
Dear community, I have one file named ca_boost_feature.txt, Feature selection (Boosting:0.0025,5)! H.2.C C.1.D C.3.R E.0.N C.2.S C.0.G H.3.G log file: ep If I want to use the second line of this file, how to read it into R? varr<-read.table("/home/cdu/operon/carbonic/ca_boost_feature.txt", sep=" ", skip=1, header=F, strip.white=TRUE, nrows=1) Warning message: In
2010 May 25
4
R eat my data
HI, Dear R community, My original file has 1932 lines, but when I read into R, it changed to 1068 lines, how comes? cdu@nuuk:~/operon$ wc -l id_name_gh5.txt 1932 id_name_gh5.txt > gene_name<-read.table("/home/cdu/operon/id_name_gh5.txt", sep="\t", skip=0, header=F, fill=T) > dim(gene_name) [1] 1068 3 -- Sincerely, Changbin -- Changbin Du DOE Joint Genome
2010 Apr 19
0
help in output file
HI, Dear R-community, I AM using the following codes to grow tree and plot tree: # Classification Tree with rpart library(rpart) pdf(file="/home/cdu/changbin/dimer_tree.pdf") # grow tree fit.dimer <- rpart(outcome ~ ., method="class", data=p.dimer[,2:402]) plotcp(fit.dimer) # visualize cross-validation results # plot tree plot(fit.dimer, uniform=TRUE,
2012 Nov 14
1
R wildcards, sapply and as.factor
I want to change the type to factor of all variables in a data frame whose names match a certain pattern. So here I am trying to change the type to factor of all variables whose name begins with?namestub?in the dataframe?df. attach(df)sapply(grep(glob2rx("namestub*"),names(df)),as.factor) But this doesn't work since >levels(df$namestub1)NULL
2005 Nov 09
8
Element-by-element multiplication operator?
Is there an element-by-element multiplication in R, like the .* operator in Matlab? eg: A (2x3) B (2x3) C=A.*B C (2x3) C = [[a11*b11 a12*b12 a13*b13]; [a21*b21 a22*b22 a23*b23]] I can't find one... Thanks -Mike Gates
2007 Mar 10
3
long character string problem
Hi All I am having 2 very long character strings (550chars) and I want to put them as expressions together with c(). The problem is that I also get these double-quotes, as seen below in 'fct'. How can I remove these double-quotes? I tried as.name() but it did not work (because of size?). These are creating trouble with subsequent programs, which I tested with strings that for some
2010 Jun 02
1
how to label the som notes by the majority vote
HI, Dear R community, I am using the following codes to do the som. I tried to label the notes by the majority vote. either through mapping or prediction. I attached my output, the left one dont have any labels in the note, the right one has more than one label in each note. I need to have only one label for each note either by majority vote or prediction. Can anyone give some suggestions or
2012 Feb 16
2
how to rbind matrices from different loops
Dear R experts, I am having difficulty using loops productively and would like to please ask for advice. I have a dataframe of ids and groups. I would like to break down the dataframe into groups, find the unique sets of ids, then reassemble. My thought was to use a loop, but I have been unable to finish this loop in a logical way. I would like to find the unique ids for group 1, group 2,
2008 Nov 29
2
Reading mixed tables
Dear R buddies, This weekend I became interested in solving Google Code Jam problems using R. I guess R may work very well in this kind of contests but the input of file has been a problem for me. Take this case for example (http://code.google.com/codejam/contest/dashboard?c=agdjb2RlamFtchALEghjb250ZXN0cxjRzBQM), the files are usually of the form: A(number of lines for group 1) a11 a12 a13 a21
2019 Feb 02
2
[llvm-xray] llvm-xray cannot log every functions
Hi there, I have a problem using the function call tracing tools that is designed in llvm tools set. My aim is to record every function call that a program makes when it run. However, for whatever reason, a simple matrix multiply c program that I wrote cannot record all the function calls that happened when the program run. Here is the program: matrix.c #include <stdio.h> void
2009 Jul 10
3
strange strsplit gsub problem 0 is this a bug or a string length limitation?
I was working with the rmetrics portfolioBacktesting function and dug into the code to try to find why my formula with 113 items, i.e. A1 thru A113, was being truncated and I only get 85 items, not 113. Is it due to a string length limitation in R or is it a bug in the strsplit or gsub functions, or in my string? I'd very much appreciate any suggestions ============Input script:
2010 Dec 16
1
my function does not work for large data set
Dear R community, I have one function, it works for small data set, but does not work on large data set, can anyone help me with this? > #creat new variable by dividing each aa dimer by total_length. > imper<-function(x, file) { + round(x/file$length, 5) + } > dim(test) [1] 999 2402 > test[varname[2:2401]]<-
2008 Sep 09
1
creating table of averages
Dear Colleagues, I have a dataframe with variables: [1] "ID" "category" "a11" "a12" "a13" "a21" [7] "a22" "a23" "a31" "a32" "b11" "b12" [13] "b13" "b21"
2010 May 12
1
exact the variables used in tree construction
> fit.dimer <- rpart(as.factor(out) ~ ., method="class", data=p_df) > > fit.dimer$frame[, "var"] [1] NE WC <leaf> TA <leaf> <leaf> WG WD WW WC [11] <leaf> <leaf> <leaf> CT <leaf> FC <leaf> YG QT <leaf> [21] <leaf> <leaf> NW DP DY <leaf> SK
2006 Dec 31
7
zero random effect sizes with binomial lmer
I am fitting models to the responses to a questionnaire that has seven yes/no questions (Item). For each combination of Subject and Item, the variable Response is coded as 0 or 1. I want to include random effects for both Subject and Item. While I understand that the datasets are fairly small, and there are a lot of invariant subjects, I do not understand something that is happening
2012 Nov 16
1
polycor package
I am currently working with R's polycor package and I have encountered a problem. I tried to follow the steps as outlined in the sem.pdf file where a CFA model is run using polychoric correlations. Every time I run the command sem(model, data, N=.), I get the following warning message: Warning message: In if (orthogonal) { : the condition has length > 1 and only the first element will be
2010 Apr 23
1
help in conditional histogram
Dear Dr. Sarkar, When I try to run the codes, I found the following problem: > h<- sample(1:14, 319, rep=T) > c<- sample(1:14, 608, rep=T) > n<- sample(1:14, 1140, rep=T) > vt<-c(h, c, n) > ta<-rep(c("h", "c", "n"), c(319, 608, 1140)) > > to<-data.frame(vt,ta) > library(lattice) Attaching package: 'lattice'
2010 Sep 07
1
change the for loops with lapply
cv.fold<-function(i, size=3, rang=0.3){ cat('Fold ', i, '\n') out.fold.c <-((i-1)*c.each.part +1):(i*c.each.part) out.fold.n <-((i-1)*n.each.part +1):(i*n.each.part) train.cv <- n.cc[-out.fold.c, c(2:2401, 2417)] train.nv <- n.nn[-out.fold.n, c(2:2401, 2417)] train.v<-rbind(train.cv, train.nv) #training data for feature
2019 Nov 28
2
Question on TBAA and optimization
TBAA Question. Please consider the following test case. ---Snip-- struct B { int b1; int b2; }; struct C { int b1; }; struct A { int a1; struct C SC; int a2; }; int foo1(struct A * Aptr, struct B* Bptr) { int *a = &Aptr->SC.b1; *a=10; Bptr->b1 = 11; return *a; } int foo2(struct A * Aptr, struct B* Bptr) { Aptr->SC.b1=10; Bptr->b1 = 11; return
2010 Apr 13
1
Lapack, determinant, multivariate normal density, solution to linear system, C language
r-devel list, I have recently written an R package that solves a linear least squares problem, and computes the multivariate normal density function. The bulk of the code is written in C, with interfacing code to the BLAS and Lapack libraries. The motivation here is speed. I ran into a problem computing the determinant of a symmetric matrix in packed storage. Apparently, there are no explicit