similar to: reading csv file : blanks

Displaying 20 results from an estimated 1000 matches similar to: "reading csv file : blanks"

2009 Feb 19
2
counting strings in a column
Dear All, I have a query : what is the command to count number of repeated words in a column. for ex: a = oranges oranges apples apples grape oranges apple pine the result should be oranges 3 apples 3 grape 1 pine 1 is there an easy way for this. Thanks, Nataraju GM R & D Bangalore -- "No relationship is Static .. You either Step up or Step down" [[alternative HTML
2009 Apr 24
2
displaying percentage in bar plot
Hi, I have a query regarding barplot I have a following data AIS LEvel 1 2 3 body region A 10 15 20 B 15 25 15 Now I want to plot a barplot and in each bar (corresponding a body region), I need a percentage of AIS level 1 displayed in the plot. Is there an
2009 Apr 30
1
factor issue
Hi, I have a column which I have to convert from factors to numeric. I am using the command as.numeric(variable) to do this. But when I convert the numeric value becomes different from factor . for example. > class(B) [1] "factor" > B [1] 180 <NA> 183 175 163 155 <NA> 188 191 160 170 165 152 170 165 [16] 163 160 163 165 <NA> > as.numeric(B)
2008 Sep 08
7
Question about multiple regression
Dear R-list, maybe some of you could point me in the right direction: Are you aware of any FREE Fortran or Java libraries/actual pieces of code that are VERY efficient (time-wise) in running the regular linear least-squares multiple regression? More specifically, I have to run small regression models (between 1 and 15 predictors) on samples of up to N=700 but thousands and thousands of them. I
2009 Apr 23
4
rbind data frames stored in a list
Hello everyone! I have a list X with 3 elements, each of which is a data frame, for example: a<-data.frame(a=1,b=2,c=3) b<-data.frame(a=c(4,7),b=c(5,8),c=c(6,9)) c<-data.frame(a=c(10,13,16),b=c(11,14,17),c=c(12,15,18)) X<-list() X[[1]]<-a X[[2]]<-b X[[3]]<-c (X) How can I most effectively transform X into a data frame with columns a, b, and c? I would love to find a generic
2009 Apr 28
4
Producing customized tickmarks when producing a graph using "curve"
Hello! I am using function "curve" to create a line graph. I was wondering, if it's possible to "turn off" the default tick marks and introduce those tick marks in specific locations. For example, currently in my X axis tick marks are (automatically) at 10, 11, 12, 13 but I want them to be in 5 specific locations, like 9.89, 10.34, etc. Any hint would be greatly
2009 Mar 26
2
Analogy for %in% for the whole columns (rather than individual values)
Hello! I have a matrix a with 2 variables (see below) that contain character strings. I need to create a 3rd variable that contains True if the value in column x is equal to the value in column y. The code below does it. a<-data.frame(x=c("john", "mary", "mary", "john"),y=c("mary","mary","john","john"))
2009 Feb 11
2
changing settings on a barchart (lattice)
Hello! I apologize - I never used lattice before, so my question is probably very basic - but I just can't find the answer in the archive nor in the documentation: I have a named numeric vector p of 6 numbers (of the type 6 numbers with people's names to whom those numbers belong). I want a simple bar chart. I am doing: library(lattice) trellis.par.set(fontsize=list(text=12)) #
2009 Feb 16
2
Printing out a graph using different graphics devices
Hello, everyone! The code below allows me to produce the graph I want (I know - the colors are strange, but it's just for the sake of an example). After you run the plot<- part and then do print(plot) - that's what I want. However, when I run the bits of code below (with graphics devices) - what they print is different from the original plot. In .png, .emf, and .tiff - my dots change
2009 Apr 20
7
Fitting linear models
I am not sure if this is an R-users question, but since most of you here are statisticians, I decided to give it a shot. I am using the lm() function in R to fit a dependent variable to a set of 3 to 5 independent variables. For this, I used the following commands: >model1<-lm(function=PBW~SO4+NO3+NH4) Coefficients: (Intercept) SO4 NO3 NH4 0.01323 0.01968
2009 Apr 10
1
Random Forests: Question about R^2
Dear Random Forests gurus, I have a question about R^2 provided by randomForest (for regression). I don't succeed in finding this information. In the help file for randomForest under "Value" it says: rsq: (regression only) - "pseudo R-squared'': 1 - mse / Var(y). Could someone please explain in somewhat more detail how exactly R^2 is calculated? Is "mse"
2009 Feb 18
1
interaction.plot - gridlines and formatting legend title...
Thank you for providing advice on this graphics question. I am building an interaction.plot. d=data.frame(xx=c(3,3,2,2,1,1),yy=c(4,3,4,3,4,3),zz=c(5.1,4.2,4.4,3.5,3.3,-1.1,-1.3) d[[1]]<-as.factor(d[[1]]) d[[2]]<-as.factor(d[[2]]) print(d) interaction.plot(d$xx, d$yy, d$zz, type="b", col=c("red","blue"), legend=F, lty=c(1,2), lwd=2, pch=c(18,24),
2009 Apr 23
2
transposing a matrix - row by row?
Hello, I have a matrix that is a product of tapply on a larger data set. Let's assume it looks like this: X<-matrix(c(10,20,30,40,50,60),2,3) dimnames(X)<-list(c("1","2"),c("1","2","3")) (X) 1 2 3 1 10 30 50 2 20 40 60 Is there an efficient way of transforming this matrix into the following matrix: rows columns entries 1
2009 Feb 10
1
Putting values and axis X labels on the charts based on allEffects
Dear everybody! Need help with graphics. I am runnig a simple lm and then using allEffects from 'effects' package: require(effects) model<-lm(Y~A+B, data=mydataframe) I am trying to build (for each predictor - A and then B) a plot of means on Y. I was successful doing it like this - in one swoop: ml.eff<-allEffects(ml1, se=F) plot(ml.eff,ylab="Title of Y") Is it
2009 Mar 27
1
asking advice for Integer Programming packages
Dear everyone, I don't know much about Integer Programming but am afraid I am facing a problem that can only be solved via Integer Programming. I was wondering if those of you who have experience with it could recommend an R package. I found the following R packages: Rglpk glpk lpSolve lpSolveAPI Are there any others? Are some of them easier to use than others for a beginner? Any advice
2009 Feb 09
1
percentage of variance explained by factors
Hello! I've run a simple linear model: result<-lm(DV~A+B+C,data=Data) My Data$A,Data$B, and Data$C are factors. So, lm automatically recoded them into dummy variables. I have all the results I need but one. Question: Where could I see the variance explained by all A dummy variables together, then all B dummy variables together, and all C dummy variables together - when other predictors
2009 Feb 13
2
tapply bug? - levels of a factor in a data frame after tapply are intermixed
Hello! I have encountered a really weird problem. Maybe you've encountered it before? I have a large data frame "importances". It has one factor ($A) with 3 levels: 3, 9, and 15. $B is a regular numeric variable. Below I am picking a really small sub-frame (just 3 rows) based on "indices". "indices" were chosen so that all 3 levels of A are present:
2009 Apr 20
1
Random Forests: Predictor importance for Regression Trees
Hello! I think I am relatively clear on how predictor importance (the first one) is calculated by Random Forests for a Classification tree: Importance of predictor P1 when the response variable is categorical: 1. For out-of-bag (oob) cases, randomly permute their values on predictor P1 and then put them down the tree 2. For a given tree, subtract the number of votes for the correct class in the
2009 Mar 04
2
adding value labels on Interaction Plot
Hello - and sorry for what might look like a simple graphics question. I am building an interaction plot for d: d=data.frame(xx=c(3,3,2,2,1,1),yy=c(4,3,4,3,4,3),zz=c(5.1,4.4,3.5,3.3,-1.1,-1.3)) d[[1]]<-as.factor(d[[1]]) d[[2]]<-as.factor(d[[2]]) print(d) interaction.plot(d$xx, d$yy, d$zz, type="b", col=c("red","blue"), legend=F, lty=c(1,2), lwd=2,
2009 Apr 21
1
how to inspect content of save file
Is there a way of listing the variables contained in a file created with the save() command other than load()ing the file? I have a couple of rather larger files that I would rather not load ... Benno Pütz MPI of Psychiatry Tel: +49+(0)89-30622 222 Kraepelinstr. 2 Fax: +49+(0)89-30622 601 80804 Munich, Germany puetz@mpipsykl.mpg.de [[alternative HTML