FAQ

# R>r-help>February 2010

## 1,025 discussions - 3,688 posts

• 97

#### [R] two questions for R beginners

* What were your biggest misconceptions or stumbling blocks to getting up and running with R? * What documents helped you the most in this initial phase? I especially want to hear from people who are ...
 Patrick BurnsFeb 25, 2010 at 5:31 pmMar 26, 2010 at 4:11 am
• 45

#### [R] Use of R in clinical trials

Dear all, There have been a variety of discussions on the R list regarding the use of R in clinical trials. The following post from the STATA list provides an interesting opinion regarding why SAS ...
 Cody HamiltonFeb 17, 2010 at 8:16 pmFeb 23, 2010 at 10:53 pm
• 29

#### [R] how to make R plot under Linux

Hi, I am using R in Linux environment. How can i make plot in Linux just like in windows? thanks
 XinweiFeb 19, 2010 at 6:39 pmMay 15, 2014 at 7:56 am
• 27

#### [R] R help question: How can we enable useRs to contribute corrections to help files faster ?

Hello dear R users, *Here is the background for my question:* I just had a look at the help file for ? Yeast in the "HistData" package. In it, I found a small spelling mistake where the word ...
 Tal GaliliFeb 28, 2010 at 10:44 amMar 1, 2010 at 10:51 pm
• 26

Folks: I am trying to read in a large file. Definition of large is: Number of lines: 333, 250 Size: 850 MB The maching is a dual core intel, with 4 GB RAM and nothing else running on it. I read the ...
 Vadlamani, Satish {FLNA}Feb 5, 2010 at 1:27 amFeb 7, 2010 at 7:24 am
• 19

#### [R] tapply for function taking of >1 argument?

I'm sure I can put this together from the various 'apply's and split, but I wonder if anyone has a quick incantation: E.g. I can do tapply( data, groups, mean) but how can I do something like ...
 SjaffeFeb 2, 2010 at 8:58 pmFeb 4, 2010 at 3:52 pm
• 18

#### [R] typo in contrast package's vignettes

It seems that Eq (2) in the vignettes for the 'contrast' packages is not correct. That is, the numerator on the right hand side should be $c' \beta$ rather than $c' \lambda$, right? If I'm correct, ...
 Peng YuFeb 3, 2010 at 4:42 amFeb 4, 2010 at 7:44 am
• 17

#### [R] Generating reports from database

MY REQUIREMENT: I have a database and i want to connect to the database through R Project and using the tables from the database i need to generate the reports. can anyone plese tell me whether this ...
 ChinnaFeb 22, 2010 at 10:38 amFeb 24, 2010 at 1:08 pm
• 16

#### [R] Reading sas7bdat files directly

Hi, I have a need to process (in real-time) a large number of .sas7bdat files from within R. The problem is I don't want to convert these files to .xpt (transport) every time. So just checking if ...
 Alex BryantFeb 4, 2010 at 10:31 pmNov 26, 2010 at 1:33 pm
• 15

#### [R] counting the number of ones in a vector

Dear R users, I want to count the number of ones in a vector x. That's what I did : length( x[x==1] ) Is that a good solution ? Thank you very much, Randall
 Randall WrongFeb 26, 2010 at 2:40 pmMar 9, 2010 at 3:59 pm
• 15

#### [R] trouble with read.table and colClasses='raw'

Hi all, First off, it is surprising that there are no examples of how to use read.table() under ?read.table ! I am trying to read in a flat file of type 'raw'. It has 1000 rows and 600K columns. I ...
 Johan JacksonFeb 11, 2010 at 3:36 pmFeb 12, 2010 at 2:53 pm
• 14

#### [R] export tables to Excel files

Dear R users, I've just posted a similar question about Illustrator. This time I would like to export the results of my statistic tables and my dataframes into Excel files. Up to now I've used ...
 Ivan CalandraFeb 23, 2010 at 9:35 amFeb 25, 2010 at 11:25 am
• 13

#### [R] Loop overwrite and data output problems

Hello R users, I have been using R for a while now for basic stats but I'm now trying to get my head around looping scripts and in some places I am failing! I have a data set with c. 1200 data points ...
 RCullochFeb 26, 2010 at 1:31 pmMar 17, 2010 at 6:10 pm
• 13

I had occasion recently to read in a one-line *.csv file that looked like: "CandidateName","NSN","Ethnicity","dob","gender" "Smith, Mary Jane",111222333,"E","2/25/1989","F" That "F" (for female) in ...
 Rolf TurnerFeb 28, 2010 at 9:55 pmMar 9, 2010 at 9:09 am
• 12

I'm struggling to find any help on this seemingly simple question - how does one read data with percentage (%) or currency (?,$etc.) signs? When I try to read a data file which has any of those ...  Hrishi MittalFeb 24, 2010 at 11:15 amFeb 25, 2010 at 9:12 pm • 12 #### [R] new to R Project hi everyone, i am new to R project can anyone please help me by providing documents.... my goal is using R i have to connect to the database and i have to generate reports. Thanks in advance chinna ...  ChinnaFeb 22, 2010 at 7:49 amFeb 23, 2010 at 3:11 pm • 12 #### [R] (no subject) -- ?????????? ?? ????????? ??????.?????: http://m.ya.ru/ymail  Антон МорковинFeb 1, 2010 at 5:34 pmFeb 21, 2010 at 2:42 am • 12 #### [R] Problems with boxplot in ggplot2:qplot Dataframe closed contains balances of closed accounts: each row has month of closure (Date-type column month) and latest balance. I would like to plot by-month distributions of balances. A qplot call ...  Dimitri ShvorobFeb 14, 2010 at 6:55 pmFeb 17, 2010 at 2:54 pm • 12 #### [R] lm function in R Hello, I am trying to learn how to perform Multiple Regression Analysis in R. I decided to take a simple example given in this PDF: http://www.utdallas.edu/~herve/abdi-prc-pretty.pdf I created a ...  Something SomethingFeb 13, 2010 at 12:54 amFeb 15, 2010 at 7:42 am • 12 #### [R] Memory Problem Hi, When I run the repeat loop in R for large dataset, I got Memory problem. How can I solve these problem. -- View this message in context: http://n4.nabble.com/Memory-Problem-tp1459740p1459740.html ...  MeenakshiFeb 2, 2010 at 10:33 amFeb 8, 2010 at 4:35 pm • 11 #### [R] argh .. if/else .. why? Hello, would someone please help explain the following inconsistency in the if/else statement to me? The format of the if/else #3 below is ok, but if/else #1 is not? (I get an "unexpected else" type ...  EsmailFeb 15, 2010 at 2:01 pmFeb 16, 2010 at 5:59 pm • 11 #### [R] Plot different regression models on one graph The following variables have the following significant relationships (x is the explanatory variable): linear, cubic, exponential, logistic. The linear relationship plots without any trouble. Cubic is ...  Rhonda ReidyFeb 13, 2010 at 6:35 pmFeb 15, 2010 at 1:27 pm • 11 #### [R] WMF conversion... Hello R-Help, I've got a bit of an issue with WMF's. I am working on WindowsXP and outputting WMF format images. I then take the WMF format images and insert them in PowerPoint. I take the PowerPoint ...  Jason RupertFeb 10, 2010 at 12:16 pmFeb 11, 2010 at 1:51 pm • 11 #### [R] Problem accessing help files Hi; I posted this to the R-help last week, but there was no resolution.. Could anybody provide an idea, or alternatively direct me to another resource that might have ideas? -- I'm running R (ver ...  JonathanFeb 3, 2010 at 8:46 pmFeb 4, 2010 at 6:14 pm • 11 #### [R] Deleting many columns of a data frame with the same name in a row Hi, I have a data frame datas with half of the columns with the same name "A". I want to delete all those columns from the data frame so here is what I did: datas$A <- NULL The problem is that it ...
 AnnaFeb 2, 2010 at 4:35 pmFeb 2, 2010 at 6:55 pm
• 10

#### [R] R error- "more columns than column names"

Hi all! I am desperately trying to figure out the solution to this error, but nothing as of yet is working. As noted in an earlier post I am using GenABEL. In an attempt to read in the phenotype ...
 EuphoriaFeb 24, 2010 at 9:14 pmApr 14, 2012 at 4:00 am
• 10

#### [R] text editors

Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100226/6ff97bd8/attachment.pl
 Dwayne BlindFeb 26, 2010 at 4:10 pmMar 1, 2010 at 3:43 pm
• 10

#### [R] Normal distribution (Lillie.test())

Hi all, I have a dataset of 2000 numbers ( it's noise measured with a scoop ) Now i want to know of my data is normal distributed (Gaussian distribution). I did already: - 68-95-99.7 test - Q-Q-plot ...
 BoskenFeb 22, 2010 at 8:22 pmFeb 26, 2010 at 2:50 pm
• 10

#### [R] Fast way to determine number of lines in a file

Hi all, Is there a fast way to determine the number of lines in a file? I'm looking for something like count.lines analogous to count.fields. Hadley -- http://had.co.nz/
 Hadley WickhamFeb 8, 2010 at 2:16 pmFeb 10, 2010 at 11:08 am
• 10

#### [R] strange behaviour of median

During some experimentation in preparing R lessons I encountered this behaviour which I can not explain fully mat <- matrix(1:16, 4,4) df1 <- data.frame(mat) X1 X2 X3 X4 2.5 6.5 10.5 14.5 Expected, ...
 Petr PIKALFeb 4, 2010 at 8:32 amFeb 4, 2010 at 11:52 am
• 10

#### [R] color blending and transparency

I am using ggplot and posted this question at that helplist. It was suggested that I try a more general R-help list for a possible solution to this problem. Within ggplot, I am using geom_area with ...
 BluecuttlefishFeb 3, 2010 at 9:43 amFeb 3, 2010 at 7:45 pm
• 9

#### [R] number of Excel worksheets

Dear All, I would like to count or list the names of the existing worksheets within an .xls file. Any hints? Thaks, Gabor -- Pozsgai G?bor www.coleoptera.hu www.photogabor.com
 Gábor PozsgaiFeb 5, 2010 at 2:13 pmMay 8, 2012 at 12:51 pm
• 9

#### [R] reading data from web data sources

Hullo I'm trying to read some time series data of meteorological records that are available on the web (eg http://climate.arm.ac.uk/calibrated/soil/dsoil100_cal_1910-1919.dat) . I'd like to be able ...
 Tim CooteFeb 27, 2010 at 11:32 amFeb 28, 2010 at 3:11 am
• 9

#### [R] problem with looping on sqlSave()

Dear R users, I have a follow-up question on sqlSave(). Since most of the output from the tests I use are lists, I would like to loop to export each element of the list and append it to the sheet ...
 Ivan CalandraFeb 24, 2010 at 3:17 pmFeb 25, 2010 at 2:29 pm
• 9

Hi Fellow R Users, I recently upgraded to Mac OS X 10.5 (Snow Leopard) and had some issues downloading and running R 2.10.1. I fixed the tcl/tk problem I was originally having but it was replaced ...
 Jessica JoganicFeb 16, 2010 at 1:58 amFeb 17, 2010 at 5:19 pm
• 9

#### [R] problems with SPC charts in R

Hi all, I am using SPC techniques of plotting Xbar, R, S, P and C charts in R.For this I am using qcc package in R and also using the following document for reference ...
 VikrantFeb 4, 2010 at 6:26 amFeb 12, 2010 at 3:52 am
• 9

#### [R] Interactively editing point labels in a graph

Dear experts, I would like to be able to interactively (if possible, with mouse and clik) edit point labels in graphs, particularly in multivariate graphs, such as the biplots you get after a ...
 Trece por cientoFeb 3, 2010 at 7:57 amFeb 7, 2010 at 11:51 pm
• 9

#### [R] Import fixed-format ascii file with mixed record types

I need to import several ascii files in fixed format with two different record types. The data comes from European Labor Force Surveys, wich is a household survey. The first record type is for people ...
 Trece por cientoFeb 1, 2010 at 4:40 pmFeb 2, 2010 at 7:21 pm
• 8

#### [R] variable substitution in for loops

Friends I can't quite find a direct answer to this question from the lists, so here goes: I have several dataframes, 200+ columns 2000+ rows. I wish to script some operations to perform on some of ...
 Jon Erik WeenFeb 25, 2010 at 1:18 amMar 7, 2010 at 3:22 pm
• 8

#### [R] using grep

Hi All, I have a character vector with naems of cities in the us. I need to extract the number that appear after the word "New York", for example, x<-c("P Los Angeles44AZ", "P New York722AZ", "K New ...
 KayjFeb 26, 2010 at 6:27 pmFeb 28, 2010 at 9:44 pm
• 8

#### [R] R ANOVA gives diferent results than SPSS

I guess my subject says it all. But I loaded a dataset in spss and used the foreign package to read and save it in R. Running an anova (using the aov command) gives a different F and p value in R ...
 ProtzkoFeb 11, 2010 at 2:47 pmFeb 25, 2010 at 11:45 pm
• 8

#### [R] deleting column from data frame

Hi to all, test <- data.frame("X"=c(1:4),"Y"=c(5:8),"Z"=c(8:11)) test <- test[,-2] Is there a way to specify the col name "Y" to delete instead the number? Kind regards Knut
 Knut KruegerFeb 23, 2010 at 12:04 pmFeb 23, 2010 at 5:44 pm
• 8

#### [R] What is the difference between expression and quote when used with eval()?

I made the following example to see what are the difference between expression and quote. But I don't see any difference when they are used with eval()? Could somebody let me know what the difference ...
 Blue skyFeb 19, 2010 at 5:42 pmFeb 21, 2010 at 8:34 am
• 8

#### [R] Procedure not working for actual data

Hello all, I have what i feel is a unique situation which may not be resolved with this inquiry. I have constructed the below data set so that i may give an example of what im doing. The example ...
 LCOG1Feb 17, 2010 at 11:34 pmFeb 18, 2010 at 6:38 pm
• 8

#### [R] AFTREG with ID argument

Dear all, I have some trouble using the "id"-argument with aftreg (accelerated failure time regression analysis from the eha library). As far as I understand it, the id argument is used to group ...
 Philipp RappoldFeb 5, 2010 at 10:30 amFeb 18, 2010 at 5:09 pm
• 8

#### [R] lattice/ylim: how to fix ylim[1], but have ylim[2] dynamically calculated?

Hello, When drawing "barcharts", I find it not helpful if ylim[1] != 0 - bars for a quantity of 0, that do not show a length of 0 are quite non-intuitive. I have tried to study but am unable to ...
 Johannes GraumannFeb 14, 2010 at 3:33 pmFeb 15, 2010 at 4:39 pm
• 8

#### [R] ggplot2 stacked line plot

Hi all, I have been hunting around for hours trying to figure out how to generate a stacked line chart using ggplot2. This type of chart can be generated in excel 2007 by selecting: Chart type Line ...
 Liam BlanckenbergFeb 8, 2010 at 4:40 amFeb 11, 2010 at 2:06 am
• 8

#### [R] Why does aggregate fail?

I am trying to get hourly totals, given 15-minute bins. s = seq(0, 95, 1) s = floor(s/4) # 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 . . . [1] 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 [26] 6 6 6 7 7 ...
 James RomeFeb 7, 2010 at 6:08 pmFeb 7, 2010 at 7:23 pm
• 8

#### [R] How do I use "tapply" in this case ?

Dear R-helpers , I have a simple loop as follows, however, to be more efficient, I would like to use any apply functions (tapply, I suppose) But how can I do this ? I am not very clear about this. # ...
 Carrie LiFeb 5, 2010 at 2:51 amFeb 5, 2010 at 2:17 pm
• 8