similar to: read.table with header and text data

Displaying 20 results from an estimated 4000 matches similar to: "read.table with header and text data"

2005 Nov 23
3
Infinite recursion in S3 methods crashes R on windows (related to PR#8203?)
Hi, Infinite recursion in S3 methods seem to crash R on Windows 2000 (R terminating with the ("Rgui.exe has generated errors...") message, rather than throwing an error. This happens with both Rgui and Rterm. The following toy example triggers this: myf <- function(x, ...) UseMethod("myf") myf.default <- function(x, ...) myf(x) myf(1) ...R crashes... Which I
2005 Apr 05
1
summing columns using partial labels
I have a dataset of the form Year tosk.fai tosk.isd tosk.gr ....... tosk.total hysa.fai hysa.isd ... and so on. I want to sum all the columns using the first four letters in the columns label(e.g. 'tosk', 'hysa' etc.). How can you do that? Also, the sums should be without the '.total'column (e.g. 'tosk.total') as this serves as a check that
2005 Apr 20
2
Suggestions for manipulating formula objects
I'm trying to manipulate/change a formula prior to passing it to another function. A simplified example: User passes formula to my function: y~x My function does: lm(transform(y)~x) Here, transform() is added to the model's response. What is the best way to accomplish this?
2005 Apr 13
1
how to separate a string
hello, i wonder how is string represent in R. if i have a string s= "hello", how can i refer to first character in the string s? also if i have s1 = "hello.1", s2 = "ok.1", how can i separate the s1 into "hello" "1" and s2 into "ok" and "1"? I have tried to use the substring function, but i don't where i can get the index
2005 Apr 13
1
i param in "for" loop does not takes zeros?
Hi all Is there any reason why the parameter i in a "for" loop ignores a value of zero? For example sim=c() p=.2 for(i in 0:5) {sim[i]=dbinom(i,5,p) } sim [1] 0.40960 0.20480 0.05120 0.00640 0.00032 In this example the quantile i= 0 was ignored since dbinom(0,5,p) [1] 0.32768 The same behaviour occurs if I use a while loop to perform the same calculation: sim=c() p=.2 i=0
2005 May 04
1
Questions about the intersection area under two kernel densities
Hi there, I am working on a project which needs the value of the interaction area under two distributions( eatimated by kernel density estimators). For example: x<-rnorm(100,0,1) y<-rnorm(100,0.2,1) density(x) # This produces the summary of dependent variable and independent variable. How can I get the individual values of variables and reform a curve to calculate the area under
2005 Apr 21
2
local average
Hello, probably this isn't hard, but I can't get R to do this. Thanks for your help! Assume I have a matrix of two covariates: n <- 1000 Y <- runif(n) X <- runif(n,min=0,max=100) data <- cbind(Y,X) Now, I would like to compute the local average of Y for each X interval 0-1, 1-2, 2-3, ... 99-100. In other words, I would like to obtain 100 (local) Ybars, one for each
2004 Aug 20
3
legends on the outside of the "box"
Hi R People: Here is a simple set of commands: >x1 <- 1:10 >x2 <- sqrt(x1) >plot(x1) >points(x2,col="red",pch=3) >legend(2,8,legend=c("First","Second"),col=c("black","red"),pch=c(1,3)) > Fine. Now, I would like to put the legend box on the outside of the plot itself, perhaps in the lower left hand corner. I've been
2005 Apr 06
2
HP-UX and IRIX recent builds? Any other rare platforms?
I am revising the section in R-admin on platforms. When I asked about locales earlier this year I got no reply about HP-UX and IRIX, so I will presume that no one has built R on those OSes recently. If you have, please send me the OS number and the flags you used. Platforms where I have seen recent reports: Linux MacOS X Solaris 8, 9, 10 (any Solaris 7 users please let me know) AIX 5.1
2005 Apr 07
2
vectorized approach to cumulative sampling
Hi All, I need to sample a vector ("old"), with replacement, up to the point where my vector of samples ("new") sums to a predefined value ("target"), shortening the last sample if necessary so that the total sum ("newsum") of the samples matches the predefined value. While I can easily do this with a "while" loop (see below for example
2004 Jun 22
2
question about window and inserting value
Hi again R People: I have the following time series: >x.ts Jan Feb Mar Apr May Jun Jul Aug Sep 2000 0.95 0.66 0.83 0.66 -1.45 -1.25 0.33 1.03 -0.48 2001 2.55 1.21 -1.10 -0.63 0.01 -2.20 -0.51 1.12 1.11 2002 -1.37 0.55 -0.63 -0.56 0.92 -1.73 0.59 0.77 0.30 2003 0.55 -0.01 -0.54 2.27 -1.29 -0.23 0.09 -0.50 -0.61 Oct Nov Dec 2000 0.84 -1.35
2005 May 03
4
Classes and methods
Hi R people: I would like to learn about classes, methods, S3 and S4. Which book would be the most helpful for this info, please: the green one or the white(and blue) one? Or is there something that would be even better, please? Thanks in advance. Sincerely, Laura Holt mailto: lauraholt_983 at hotmail.com R 2.1.0 Windows. trying to learn
2005 Jul 10
2
Off topic -2 Ln Lambda and Chi square
Dear R : Sorry for the off topic question, but does anyone know the reference for the -2 Ln Lambda following a Chi Square distribution, please? Possibly one of Bartlett's? Thanks in advance! Sincerely, Laura Holt mailto: lauraholt_983 at hotmail.com
2004 Aug 11
2
str and Surv objects
Dear R People: I used the "Surv" function to produce the following object: >a <- Surv(1:4,2:5,c(0,1,1,0)) a [1] (1,2+] (2,3 ] (3,4 ] (4,5+] >str(a) Error in "[.Surv"(object, 1:ile) : subscript out of bounds > Why does str(a) give an error, please? Or did I do something wrong? Thanks in advance. R Version 1.9.1 Windows Sincerely, Laura Holt mailto: lauraholt_983
2005 Feb 23
3
and [ESS] Starting ESS
Dear R People: I have finally seen the error of my ways and have decided to use ESS for R and S + stuff. However, I have a question right from the beginning. I'm somewhat confused by the installation instructions. Do I install XEMACS or ESS first, please? Windows XP R Version 2.0.1 (S + 6.2) Thanks so much! Sincerely, Laura Holt mailto: lauraholt_983 at hotmail.com
2004 Aug 19
2
ROracle and vector elements
Hi there! Is ROracle available for Windows, please? I found a download site, but it's really for UNIX/Linux. Here is a "thought question", please: Why do the vector elements start at location 1 rather than zero, as C does? Thanks in advance! R Version 1.9.1 Windows Sincerely, Laura Holt mailto: lauraholt_983 at hotmail.com
2005 Apr 04
3
plotting mathematical notation and values substitution
Dear R-users, I'm trying to add a title on a plot with both mathematical notation and values substitution. I read the documentation and search the mailing list but I was not able to solve my problem. Actually, there is a message by Uwe Ligges on June 2003 which addresses a question very close to mine, but the code provided doesn't work. The code is the following: # I add this to let you
2004 Nov 16
2
changing character to a vector name
Dear R People: I would like to generate a vector/variable name from within a loop to be passed to a table function. This is what I have so far: >assign("p1",paste("raw3.df$",rw2$V1[3],sep="")) >p1 [1] "raw3.df$CITIZEN" > Essentially, I want to use the raw3.df$CITIZEN along with another value to generate a table. However, I'm stuck here. I
2005 Apr 19
1
controlling the x axis of boxplots
v 2.0.1 (sooooh old!) on Win2k I think I know the answer to this but I can hope ... I have data for continuous variables (measures of residents) by a categorical variable in range (1,22), the units in which they live. I want to plot these data with a pair of boxplots one above another with same x-axis (1,22) using par(mfrow=c(2,1)) and then plotting first for the women then for the men.
2004 Jun 21
2
question about latex command in Hmisc
Hi R People: I got the following error from using the "latex" command from Hmisc; >latex(bbm) 'latex' is not recognized as an internal or external command, operable program or batch file. Warning message: cmd execution failed with error code 1 in: shell(cmd, wait = TRUE, intern = output) > I was printing a matrix to a Latex File. This worked fine in Version 1.8. This