Re: [R] RMySql inserts \r when using dbWriteTable

2008-11-05 Thread Prof Brian Ripley
You will find this discussed in the list archives: most recently see the thread starting https://stat.ethz.ch/pipermail/r-help/2008-August/170562.html Bottom line: the package maintainer needs to correct a bug in the package code (and did not do so in the subsequent release 0.6-1), but meantim

Re: [R] Reshape a matrix

2008-11-05 Thread cruz
On Thu, Nov 6, 2008 at 8:53 AM, dinesh kumar <[EMAIL PROTECTED]> wrote: > Dear R users, > > I have a matrix like > > A X1 > B Y2 > C Z3 > > I want to reshape this matrix into this format > >X Y Z > A 1 > B 2 > C 3 > is this what you

Re: [R] how to make a multiple plot

2008-11-05 Thread Dieter Menne
amy rheanita yahoo.com> writes: > I'm a student. now, I'm studying Nelson-Siegel Extended, a term structure > model. I can analyze - estimate parameters and make aplot  - manually, > from data bond in a day. > I can analyze bond data in a month, like make multiple plot for different > bont dat

[R] How to return individual equation from {aidsEst} in package [micEcon]?

2008-11-05 Thread Yang Wan
Hi, R core team I am using the function {aidsEst} in package [micEcon] to do an AIDS model now. So far, everything is good. But I want to test the auto correlation and heteroskedasticity of the individual equation from AIDS demand system. How can I return the individual equation? PS: ser

[R] lars package - lasso

2008-11-05 Thread Derow, Catherine Kari
Please could you clarify for me for me when using the lars (lasso) package what the parameter 'intercept' refers to and what the advantages and disadvantages of making this TRUE or FALSE are and when it should be TRUE and when FALSE. Also please could you clarify how 'eps' works and when it shoul

[R] Reshape a matrix

2008-11-05 Thread dinesh kumar
Dear R users, I have a matrix like A X1 B Y2 C Z3 I want to reshape this matrix into this format X Y Z A 1 B 2 C 3 Thanks in advance for your help. Dinesh -- Dinesh Kumar Barupal Junior Specialist Metabolomics Fiehn Lab UC

[R] RMySql inserts \r when using dbWriteTable

2008-11-05 Thread Albert Nigrin
I am using R 2.8 and the latest versions of RMySQL on a Windows XP 64 bit machine. I was wondering if someone could help me figure out how to use dbWriteTable without inserting \r into my table. Consider the following code snippet, which is run after I connect to my database. myDFOut = dbReadTab

Re: [R] how to source file with arugments

2008-11-05 Thread Dieter Menne
Jiqiang Guo gmail.com> writes: > As we know when we use R to execute a r program we can add arguments like > '--args p1 p2'. But when I am sourcing another file, is there a way to set > up some arguments for the sourced program. Thanks! > In general, you can use Sys.getenv() and .setenv() to

Re: [R] trouble with html help

2008-11-05 Thread Prof Brian Ripley
Please note that a more accurate subject line would be 'Problems with links generated by the search page in HTML help in your browser here> on obsolete versions of R' The problem is almost certainly your browser, not R. Later versions (>= 2.7.2) of R mention this in the R-admin manual and pro

[R] trouble with html help

2008-11-05 Thread Samu Mäntyniemi
I have this problem with R 2.6.1 and 2.7.1 (have not tried others) running on Windows XP: Html help has wrong links to help files. The index.html is correctly found from file:///C:/PROGRA~1/R/R-26~1.1/doc/html/index.html as well as the search engine file:///C:/PROGRA~1/R/R-26~1.1/doc/html/s

Re: [R] Convert text into a variable name

2008-11-05 Thread Daniel Nordlund
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Xing Yuan > Sent: Wednesday, November 05, 2008 9:37 PM > To: Simon Blomberg > Cc: r-help@r-project.org > Subject: Re: [R] Convert text into a variable name > > Thanks for the reply, Simon! > > I just

Re: [R] Methods dispatch and inheritance R.oo

2008-11-05 Thread Henrik Bengtsson
Hi, if you instead do: setConstructorS3("ClassB", function(B=15) { extend(ClassA(), "ClassB", .size2 = B ); }) then you'll get: > objB <- ClassB(); > objB [1] "Class B: 15" What was wrong with your setup? What you ended up doing was to "extend" an object of class 'character' (with val

Re: [R] Convert text into a variable name

2008-11-05 Thread Xing Yuan
Thanks for the reply, Simon! I just want to name a object as the text string. So I have "AGE" then how can I do somecommand("AGE") = 39 then I should have AGE = 39 in my data set. Joe On Thu, Nov 6, 2008 at 12:28 AM, Simon Blomberg <[EMAIL PROTECTED]>wrote: > ?assign > > On Thu, 2008-11-0

Re: [R] Convert text into a variable name

2008-11-05 Thread Simon Blomberg
?assign On Thu, 2008-11-06 at 00:03 -0500, Xing Yuan wrote: > Hello R users, > > Does anybody know what command I should use to convert the text string "AGE" > to be variable name AGE so I can assign value to it > e.g. AGE = 39? > > Thank you very much! > > Joe > > [[alternative HTML ver

[R] how to source file with arugments

2008-11-05 Thread Jiqiang Guo
HI, All, As we know when we use R to execute a r program we can add arguments like '--args p1 p2'. But when I am sourcing another file, is there a way to set up some arguments for the sourced program. Thanks! Regards, [[alternative HTML version deleted]] __

[R] Convert text into a variable name

2008-11-05 Thread Xing Yuan
Hello R users, Does anybody know what command I should use to convert the text string "AGE" to be variable name AGE so I can assign value to it e.g. AGE = 39? Thank you very much! Joe [[alternative HTML version deleted]] __ R-help@r-project.o

Re: [R] trouble with for loop

2008-11-05 Thread Peter Alspach
?try > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Kyeongmi Cheon > Sent: Thursday, 6 November 2008 4:56 p.m. > To: R help mailing list > Subject: [R] trouble with for loop > > Hello, > I'm having two similar problems with for loop and I would

[R] trouble with for loop

2008-11-05 Thread Kyeongmi Cheon
Hello, I'm having two similar problems with for loop and I would appreciate any help or comment. I want to use "for loop" to calculate series of initial values for an optimization problem. But some initial values have my function quit due to problems like calculating the inverse of singular mat

[R] how to make a multiple plot

2008-11-05 Thread amy rheanita
Sorry I have a bad English. I'm a student. now, I'm studying Nelson-Siegel Extended, a term structure model. I can analyze - estimate parameters and make aplot  - manually, from data bond in a day. I can analyze bond data in a month, like make multiple plot for different bont date and make a mult

Re: [R] Problems computing 2-way-mixed-model ANOVA

2008-11-05 Thread Rolf Turner
On 6/11/2008, at 11:13 AM, Lucas Eggert wrote: Dear Experts, I am new to R and unfortunately cannot start with a simply statistical analysis: I manually determined the volume of the right and left hippocampus in a group of meditators and in a group of controls. My data-sheet looks as follows:

Re: [R] Incrementally building histograms

2008-11-05 Thread Gabor Grothendieck
You can eliminate the loop like this (untested): cnt <- function(file) { data <- scan(file, quiet = TRUE) hist(data, plot = FALSE, breaks = breaks)$counts } Reduce("+", sapply(files, cnt)) On Wed, Nov 5, 2008 at 8:01 PM, Andre Nathan <[EMAIL PROTECTED]> wrote: > Hello > > I need to build a his

Re: [R] Incrementally building histograms

2008-11-05 Thread Rolf Turner
On 6/11/2008, at 2:01 PM, Andre Nathan wrote: Hello I need to build a histogram from data (numbers in the [0,1] interval) stored in a number of different files. The total amount of data is very large, so I can't load everything to memory and then simply call hist(). Since what I actually n

Re: [R] Calling optim and .C

2008-11-05 Thread Rolf Turner
On 6/11/2008, at 11:39 AM, Armin Meier wrote: Hi all, I want to optimize a function fn using optim. This function fn calls the .C function in it with a function name and arguments given to fn, i.e. something like this pseudocode: fn <- function(par, "some params for fn") {... .C ("Cfunction",

Re: [R] Building with MKL on Ubuntu

2008-11-05 Thread Ei-ji Nakama
Hi If you want to use MKL10(no 8 or 9), you should obey instructions of R-admin. MKL10 needs openmp. This needs gcc4.2 or later. OpenMP for Intel was necessary with MKL10.0.1.x (There was not it in a manual of MKL). # Please try an additional effect of "-liomp5" in the %*% # fp-model of Linux of

[R] Incrementally building histograms

2008-11-05 Thread Andre Nathan
Hello I need to build a histogram from data (numbers in the [0,1] interval) stored in a number of different files. The total amount of data is very large, so I can't load everything to memory and then simply call hist(). Since what I actually need are the histogram counts, I'm currently doing it l

Re: [R] How do I read a text (.csv) file to match a matrix/cross tab? (Object confusion??)

2008-11-05 Thread Kellie Wills
read.table doesn't realize the first column should be row names. Try read.table("C:/Data/R/NewTarget.csv", header=TRUE, sep=",", na.strings="NA", dec=".", row.names="tripid_nu") Kellie Wills Engineering Service Manager REvolution Computing [EMAIL PROTECTED] On Nov 5, 2008, at 3:51 PM, Farl

[R] How do I read a text (.csv) file to match a matrix/cross tab? (Object confusion??)

2008-11-05 Thread Farley, Robert
I'm having a problem reading data to set control totals for a dataframe. I want to adjust a dataframe based on a 2-d table of values, which I get by using : > CurrentX1Sums <- as.matrix(xtabs(~tripid_nu+lineon, data=SurveyData)) > CurrentX2Sums <- apply(CurrentX1Sums, 1, sum) I've created a

[R] Using a background photo in lattice--title and axes missing

2008-11-05 Thread Waichler, Scott R
I am trying to use a background photo in a lattice plot. I am using the rimage and TeachingDemos packages to plot the photo and translate from the photo coordinates in pixels to geographic coordinates, which is what I want to use for plotting contours, lines, etc. The (unrunable) code below does

Re: [R] Efficient way to fill a matrix

2008-11-05 Thread Bert Gunter
I don't think that this answers the poster's question, as he explicitly mentioned that some row and column indices could be missing. I think it's simpler and much faster to do this by matrix indexing: mx <- matrix(NA,nr = max(foo[,1]),ncol = max(foo[,2])) ## fill with NA's mx[as.matrix(foo[,1:2])

[R] Problems computing 2-way-mixed-model ANOVA

2008-11-05 Thread Lucas Eggert
Dear Experts, I am new to R and unfortunately cannot start with a simply statistical analysis: I manually determined the volume of the right and left hippocampus in a group of meditators and in a group of controls. My data-sheet looks as follows: observation subject group age ge

Re: [R] Efficient way to fill a matrix

2008-11-05 Thread Peter Dalgaard
Philipp Pagel wrote: Dear R experts, Suppose I have a data frame of three variables: foo <- data.frame(row=1:5, col=1:3, val=rnorm(15)) foo row col val 11 1 -1.00631642 22 2 0.77715344 33 3 0.17358793 44 1 -1.67226988 55 2 1.08218836 61

Re: [R] Efficient way to fill a matrix

2008-11-05 Thread stephen sefick
#reshape package should do it library(reshape) foo <- data.frame(row=1:5, col=1:3, val=rnorm(15)) cast(foo, row~col) On Wed, Nov 5, 2008 at 5:47 PM, Philipp Pagel <[EMAIL PROTECTED]> wrote: > >Dear R experts, > > Suppose I have a data frame of three variables: > >> foo <- data.frame(row=1:

[R] Efficient way to fill a matrix

2008-11-05 Thread Philipp Pagel
Dear R experts, Suppose I have a data frame of three variables: > foo <- data.frame(row=1:5, col=1:3, val=rnorm(15)) > foo row col val 11 1 -1.00631642 22 2 0.77715344 33 3 0.17358793 44 1 -1.67226988 55 2 1.08218836 61 3 1.32961329 7

[R] coxph

2008-11-05 Thread Feldman, Ruben
Hello, I ran the coxph model and everything worked fine. When I extract the output from the basehaz(y) function and was wondering if that baseline is cumulative or not. I then do: F(t,t+1)=1-exp(h_0(t+1) exp(coeff(1)*covariate(1)+...)) Does this give me the probability of death from t to t+1 (in

[R] Calling optim and .C

2008-11-05 Thread Armin Meier
Hi all, I want to optimize a function fn using optim. This function fn calls the .C function in it with a function name and arguments given to fn, i.e. something like this pseudocode: fn <- function(par, "some params for fn") {... .C("Cfunction", ...) ...} optim(par, fn, "some params for fn") In

[R] questions on RKWard

2008-11-05 Thread Horace Tso
Folks, I'm making progress moving from Windows to Linux and have RKward up and running. I read somewhere that Rkward's supposed to be the Tinn-R for linux and Tinn-R has worked out great for me. So naturally I'd like to do the following, if possible, 1. How to ask Rkward not to load the last s

Re: [R] Memory limits for large data sets

2008-11-05 Thread stephen sefick
I believe that it depends on the operating system. memory.limit() I think this is in the FAQ and search the R email list archive On Wed, Nov 5, 2008 at 2:53 PM, Alan Cohen <[EMAIL PROTECTED]> wrote: > Hello, > > I have several very large data sets (1-7 million observations, sometimes > hundreds o

Re: [R] Applying a loop with rnorm() to eliminate dupli cate coordinates in a dataframe object

2008-11-05 Thread Ben Bolker
Ricardo Bandin gmail.com> writes: > > Dear colleagues > > I found duplicate coordinates trying to convert a dataframe object (see the > attached file) into a geodata one ('geoR' package is needed). My dataframe > object consists of 2 columns with UTM geographical coordinates and a 3rd > column

[R] thanks for the help: how can I save the estimates of a regression model in a file?

2008-11-05 Thread pilar schneider
Thanks for your help the codes you gave me worked vey well! cheers Maria -- - [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Memory limits for large data sets

2008-11-05 Thread Alan Cohen
Hello, I have several very large data sets (1-7 million observations, sometimes hundreds of variables) that I'm trying to work with in R, and memory seems to be a big issue. I'm currently using a 2 GB Windows setup, but might have the option to run R on a server remotely. Windows R seems basi

Re: [R] (no subject)

2008-11-05 Thread megha patnaik
How are you starting R ? It is not a directory. Usually, if you simply say R at a shell prompt, it starts R for you. 2008/11/6 Aimin Yan <[EMAIL PROTECTED]> > In linux, when I start R, > > I get some message like this: > > Error:unexpected '/' in '"/" > > Does anyone know why? > > AMY > > Than

Re: [R] (no subject)

2008-11-05 Thread Erik Iverson
Try starting it as, R --vanilla , do you still get the error? Do you have a file called .Rprofile in your home directory? Aimin Yan wrote: In linux, when I start R, I get some message like this: Error:unexpected '/' in '"/" Does anyone know why? AMY Thanks, __

[R] (no subject)

2008-11-05 Thread Aimin Yan
In linux, when I start R, I get some message like this: Error:unexpected '/' in '"/" Does anyone know why? AMY Thanks, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-p

Re: [R] how can I save the estimates of a regression model in a file?

2008-11-05 Thread hadley wickham
On Wed, Nov 5, 2008 at 11:12 AM, pilar schneider <[EMAIL PROTECTED]> wrote: > Dear all > I need some help with R. > How can I save the estimates of a regression model in a file? > > here is what I did: > > 1) this is my regression model: > fit1 <- lm(logmilk ~ logdays + days, data=data2) > > 2) how

Re: [R] R 2.8.0 for Ubuntu Intrepid Ibex i386

2008-11-05 Thread Vincent Goulet
Le mer. 5 nov. à 12:11, Robert Zimbardo a écrit : Hi all Is there going to be a binary of R 2.8.0 for Ubuntu Intrepid Ibex i386 - i.e., not just amd 64bit? I was going to reply that the binaries have been there for a few days already, but I realize I forgot to copy them to my repository.

Re: [R] Sort help

2008-11-05 Thread Richardson, Patrick
http://www.ats.ucla.edu/stat/R/faq/sort.htm A great tutorial about sorting data in R. HTH, _ Patrick Richardson Biostatistician - Program of Translational Medicine Van Andel Research Institute - Webb Lab Grand Rapids, MI 49503 -Original Message-

Re: [R] Sort help

2008-11-05 Thread Jorge Ivan Velez
Hi Ramya, You're almost there. Just specify that you want to order all the data set based-on the third column. Here is an example: # Data information=data.frame( geneset=letters[1:7], chromosome=1, hit=c(51,24,30,17,35,55,61)) # New data information

[R] Applying a loop with rnorm() to eliminate duplicate coordinates in a dataframe object

2008-11-05 Thread Ricardo Bandin
Dear colleagues I found duplicate coordinates trying to convert a dataframe object (see the attached file) into a geodata one ('geoR' package is needed). My dataframe object consists of 2 columns with UTM geographical coordinates and a 3rd column with fish densities . To overcome the handicap I m

[R] Sort help

2008-11-05 Thread Rajasekaramya
Geneset_name #Chromosome #Hit_in_Biomart original_geneset_len Missing.genes [1,] "AGUIRRE_PANCREAS_CHR12" "1" "51" "59" "8" [3,] "AGUIRRE_PANCREAS_CHR9" "1" "24"

[R] R 2.8.0 for Ubuntu Intrepid Ibex i386

2008-11-05 Thread Robert Zimbardo
Hi all Is there going to be a binary of R 2.8.0 for Ubuntu Intrepid Ibex i386 - i.e., not just amd 64bit? Thx, RZ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] sink() within a loop. Solved

2008-11-05 Thread jgarcia
Uwe; sorry for my last mail. In effect, as you say ,I just needed to explicitly print() the object to be sinked within the loops. Thanks you, Javier > > > [EMAIL PROTECTED] wrote: >> Hello; >> It seems to me that this could even by a FAQ, but I cannot find an >> answer: >>

Re: [R] sink() within a loop

2008-11-05 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > Sent: Wednesday, November 05, 2008 10:19 AM > To: Uwe Ligges > Cc: r-help@r-project.org > Subject: Re: [R] sink() within a loop > > Well, I'll put a foo example of my problem: > >

Re: [R] sink() within a loop

2008-11-05 Thread jgarcia
Well, I'll put a foo example of my problem: I'got a list: >a <- list() >a$sublist.1 <- list() >a$sublist.1$subsublist.1 <- list() this code works: >zz <- file("foo.txt","w") >sink(zz) >a >sink() >close(zz) and generates a correct "foo.txt" file containing the structure of the list but this co

Re: [R] how can I save the estimates of a regression model in a file?

2008-11-05 Thread Chuck Cleland
On 11/5/2008 12:12 PM, pilar schneider wrote: > Dear all > I need some help with R. > How can I save the estimates of a regression model in a file? > > here is what I did: > > 1) this is my regression model: > fit1 <- lm(logmilk ~ logdays + days, data=data2) > > 2) however, I want to get the par

Re: [R] "Text" function in 3D graph

2008-11-05 Thread Duncan Murdoch
On 11/5/2008 10:59 AM, EVANS David-William wrote: Fellow R users, I often use « text » to annotate plots in 2 dimensions. Having grown up to 3 dimensions recently, I am looking for a similar function. Could anyone provide code for how to annotate points in a 3-d plot? You need to descr

Re: [R] relabeling the x-axis of a plot with discontinuous timestamps

2008-11-05 Thread Uwe Ligges
Stoesser, Jochen wrote: Hi all, I have two vectors of data: The first vector contains timestamps (as integers), however the difference between these dates varies. For instance, the vector can be c(0, 5 , 10, 20, 25, 30) so that there is a "jump" between the third and the fourth element. If

Re: [R] sink() within a loop

2008-11-05 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: Hello; It seems to me that this could even by a FAQ, but I cannot find an answer: Why a piece of code that uses sink() does not sinks anything if it is executed within a for loop? Without sink(), does it print anything in the console? If not: use print() in order to

[R] sink() within a loop

2008-11-05 Thread jgarcia
Hello; It seems to me that this could even by a FAQ, but I cannot find an answer: Why a piece of code that uses sink() does not sinks anything if it is executed within a for loop? Thanks, Javier __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] "Text" function in 3D graph

2008-11-05 Thread Uwe Ligges
EVANS David-William wrote: Fellow R users, I often use « text » to annotate plots in 2 dimensions. Having grown up to 3 dimensions recently, I am looking for a similar function. Could anyone provide code for how to annotate points in a 3-d plot? Depends on the framework you are usin

Re: [R] Importing data to a multidimensional array

2008-11-05 Thread Uwe Ligges
Jon Wong wrote: Hi, I was wondering if I could get some help on importing data into a three-dimensional array? I am importing data from several text files: dsdir<-"c:/documents and settings/desktop/07082008/" # path to files dsfb1<-"07082008-DI4129b.dat" # file base name firsthour<-13 # firs

Re: [R] CPU usage on Windows (R 2.7.1)

2008-11-05 Thread Uwe Ligges
Borja Soto Varela wrote: Dear R-users, I'm using R (2.7.1) under windows and I've got a function written in R that calls a Fortran 77 subroutine using both interface function (.C and .Fortran). The Fortran 77 source was compiled to a shared library using g77 (3.4.5). When I call the R wrapper

[R] CPU usage on Windows (R 2.7.1)

2008-11-05 Thread Borja Soto Varela
Dear R-users, I'm using R (2.7.1) under windows and I've got a function written in R that calls a Fortran 77 subroutine using both interface function (.C and .Fortran). The Fortran 77 source was compiled to a shared library using g77 (3.4.5). When I call the R wrapper function, it will use the 100

[R] Importing data to a multidimensional array

2008-11-05 Thread Jon Wong
Hi, I was wondering if I could get some help on importing data into a three-dimensional array? I am importing data from several text files: dsdir<-"c:/documents and settings/desktop/07082008/" # path to files dsfb1<-"07082008-DI4129b.dat" # file base name firsthour<-13 # first hour of observatio

[R] Using RGDAL to "copy" header information...

2008-11-05 Thread Jonathan Greenberg
R-geographers... I'm trying to solve a problem to implement a line-by-line tiled processing using RGDAL (read 1 line of an image, process the one line, write one line of the image to a binary file). Everything except for the final step I'm able to do using a combination of RGDAL and r-base c

[R] how can I save the estimates of a regression model in a file?

2008-11-05 Thread pilar schneider
Dear all I need some help with R. How can I save the estimates of a regression model in a file? here is what I did: 1) this is my regression model: fit1 <- lm(logmilk ~ logdays + days, data=data2) 2) however, I want to get the parameters estimates for each individual (by group): so i did the fol

Re: [R] slow aggregate function

2008-11-05 Thread stephen sefick
sounds like plyr although I have never used it... If you want help with code you need to provide reproducible examples. On Wed, Nov 5, 2008 at 5:11 AM, Bert Jacobs <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I've written the following line of code to make a summary of some data: > > > > Final.Da

[R] library(gdata) fails

2008-11-05 Thread David Epstein
I wanted to install the package "gdata". Here are the commands I gave and the responses: install.packages("gdata") Warning in install.packages("gdata") : argument 'lib' is missing: using '/Users/dbae/Library/R/library' trying URL 'http://cran.uk.r-project.org/bin/macosx/universal/contrib/2.8/gd

Re: [R] Internal and displayed precision of numbers

2008-11-05 Thread Uwe Ligges
Oliver Bandel wrote: Hello, many thanks! BTW: I read your book. :) It's quite good. Thank you. But I didn'tfoud the precision-stuff in it. Adding information about this topic in the next edition might be a good idea. These numeric things are an interesting and important topic, of cours

Re: [R] Dataframe help

2008-11-05 Thread Erik Iverson
Hello - Rajasekaramya wrote: Hi there, I have a dataframe length.unique.info length.unique.info abc 12 345 def 16 550 lmn 6 600 Is this really the output when you print your data.frame? You may have column names for columns 1, 2, and 3? Is the first column a column of row.names, o

Re: [R] matrix indexing and update

2008-11-05 Thread Jorge Ivan Velez
Dear Murali, Here is one way: set.seed(123) a <- matrix(abs(rnorm(100)), 10) b <- rnorm(10) apply(a,2,function(x) ifelse(b>quantile(b,probs=0.75),-x,x)) HTH, Jorge On Wed, Nov 5, 2008 at 11:30 AM, <[EMAIL PROTECTED]> wrote: > Folks, > > I have a matrix: > > set.seed(123) > a <- matrix(rn

[R] "Text" function in 3D graph

2008-11-05 Thread EVANS David-William
Fellow R users, I often use « text » to annotate plots in 2 dimensions. Having grown up to 3 dimensions recently, I am looking for a similar function. Could anyone provide code for how to annotate points in a 3-d plot? Your help is greatly appreciated. For Sébastien Velazquez. -

Re: [R] matrix indexing and update

2008-11-05 Thread Dimitris Rizopoulos
you almost have it, e.g., check the following: set.seed(123) a <- matrix(rnorm(100), 10) b <- rnorm(10) ind <- b > quantile(b, 0.75) a[ind, ] <- -a[ind, ] a I hope it helps. Best, Dimitris [EMAIL PROTECTED] wrote: Folks, I have a matrix: set.seed(123) a <- matrix(rnorm(100), 10) And a v

[R] read Idrisi file

2008-11-05 Thread Abdou Ali
Dear Sirs, Is there a R function to read an Idrisi image (*.rdc & *.rst) Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting g

Re: [R] Internal and displayed precision of numbers

2008-11-05 Thread Oliver Bandel
Hello, many thanks! BTW: I read your book. :) It's quite good. But I didn'tfoud the precision-stuff in it. Adding information about this topic in the next edition might be a good idea. Nevertheless it explains crucial points very good, and from that starting point, it's easier to understand the

[R] matrix indexing and update

2008-11-05 Thread murali . menon
Folks, I have a matrix: set.seed(123) a <- matrix(rnorm(100), 10) And a vector: b <- rnorm(10) Now, I want to switch the signs of those rows of a corresponding to indices in b whose values exceed the 75 %-ile of b which(b > quantile(b)[4]) [1] 2 6 10 so I want, in effect: a[2, ] <- -a[2,

Re: [R] fine grain tick marks for zoo plots

2008-11-05 Thread tolga . i . uzuner
Yes ! Many thanks Gabor.I'll email the relevant people on Axis about this. Tolga Tolga Uzuner Cross-Markets Chief Investments Office JP Morgan 6th Floor, 100 Wood Street London EC2V 7RF United Kingdom Asst. Lee Hesketh Tel: +44-20-3303 Fax: +44-20-77422840 "Gabor Grothendieck" <[EMAIL PR

Re: [R] perform Kruskal-Wallis test without using the built-in command in R

2008-11-05 Thread stephen sefick
homework? Anyway, look at the code for kruskal.test I think, and that should be a good start. On Tue, Nov 4, 2008 at 5:59 PM, Swanton0822 <[EMAIL PROTECTED]> wrote: > > Hi, > again i am stuck in my presentation, and i have never learn R before in my > life but need this to be done, so please help

[R] Dataframe help

2008-11-05 Thread Rajasekaramya
Hi there, I have a dataframe length.unique.info > length.unique.info abc 12 345 def 16 550 lmn 6 600 I want those names that fall under the condition (length.unique.info[,2][i] <=5 && length.unique.info[,3][i] >=500) abcder<-length.unique.info[which(length.unique.info[,2][i] <=5 && length.

[R] Ottawa area R Users meeting

2008-11-05 Thread Paul Gilbert
There will be a meeting of the Ottawa Gatineau R Users Group on Monday November 10 from 4pm to 6pm. More details are provided below. Please pass this message along to friends you think may be interested. Paul Gilbert _ Dear R friends: To get OGRUG going again I've reserved room DMS 61

Re: [R] fine grain tick marks for zoo plots

2008-11-05 Thread Gabor Grothendieck
I think the problem is that there is a bug in R itself. If we use axis instead of Axis it works even with no check at all: plotmonths<-function(z,...){ plot(z,xaxt="n",...) tt <- time(z) m <- unique(as.Date(as.yearmon(tt))) jan <- format(m, "%m") == "01" mlab <- substr(months(m[!jan]), 1, 1)

Re: [R] Simple rep() question duplicating times and dates.

2008-11-05 Thread John Kane
I don't have R on this machine to try it but it looks good to me. I had even got as far as seq() but completely missed the use of "each". Thanks very much. --- On Wed, 11/5/08, Gustaf Rydevik <[EMAIL PROTECTED]> wrote: > From: Gustaf Rydevik <[EMAIL PROTECTED]> > Subject: Re: [R] Simple rep(

Re: [R] Simple rep() question duplicating times and dates.

2008-11-05 Thread Gustaf Rydevik
On Wed, Nov 5, 2008 at 4:02 PM, John Kane <[EMAIL PROTECTED]> wrote: > > I want to create a data.frame of time and date for a year. I started with > the idea of simply producing two vectors (time and date) > > The first part ( time) is easy. > rep(1:24, 365) > > But how do I get a series of 24 d

[R] latent class analysis of nominal and continuous indicators

2008-11-05 Thread Xu Jun
Dear R-help listers, I am a new convert to R. I am trying to use a r package to conduct latent class analysis as a triangulation check of my cluster analysis using the cluster package in R. I have about 30 cases and 6 indicators, some of which are binary indicators and others are ratio-level varia

Re: [R] merge 2 txt file

2008-11-05 Thread John Kane
> From: Alessandro <[EMAIL PROTECTED]> > Subject: [R] merge 2 txt file > To: [EMAIL PROTECTED], r-help@r-project.org > Received: Tuesday, November 4, 2008, 6:52 PM > Hi all, > > > > I have two txt file with X,Y,Z column and I need to merge > together > > > > I tried > > file_all <- > merg

Re: [R] fine grain tick marks for zoo plots

2008-11-05 Thread tolga . i . uzuner
Hi Gabor, Thanks very much. I tried that: plotmonths<-function(z,...){ plot(z,xaxt="n",...) tt <- time(z) m <- unique(as.Date(as.yearmon(tt))) jan <- format(m, "%m") == "01" mlab <- substr(months(m[!jan]), 1, 1) Axis(side = 1, at = m[!jan], labels = mlab, tcl = -0.3, cex.axis = 0.7) #if(a

[R] Simple rep() question duplicating times and dates.

2008-11-05 Thread John Kane
I want to create a data.frame of time and date for a year. I started with the idea of simply producing two vectors (time and date) The first part ( time) is easy. rep(1:24, 365) But how do I get a series of 24 dates for O1 January 2005 and repeat this to 31 December 2005. It should be easy

Re: [R] Internal and displayed precision of numbers

2008-11-05 Thread John Kane
sprintf() for displayed numbers perhaps. --- On Wed, 11/5/08, Oliver Bandel <[EMAIL PROTECTED]> wrote: > From: Oliver Bandel <[EMAIL PROTECTED]> > Subject: [R] Internal and displayed precision of numbers > To: r-help@r-project.org > Received: Wednesday, November 5, 2008, 8:38 AM > Hello, > > c

Re: [R] fine grain tick marks for zoo plots

2008-11-05 Thread Gabor Grothendieck
Try if (any(jan)) ... On Wed, Nov 5, 2008 at 8:55 AM, <[EMAIL PROTECTED]> wrote: > > By way of follow-up, this will not work if the time series does not run over > a year, as the replacement of January by the year fails on the second call > to Axis. > > The following tests for this: > > plotmon

Re: [R] Avoiding loops & apply -function

2008-11-05 Thread Yohan Chalabi
"DM" == David Masson <[EMAIL PROTECTED]> on Wed, 05 Nov 2008 15:13:37 +0100 DM> I have a question concerning avoiding loops. DM> I know the function "apply" and I have used it several times, but I feel DM> blocked DM> with this situation : DM> DM> E <- array(X, dim =

[R] Avoiding loops & apply -function

2008-11-05 Thread David Masson
I have a question concerning avoiding loops. I know the function "apply" and I have used it several times, but I feel blocked with this situation : E <- array(X, dim = c(L,nlon,nlat) ) data <- matrix(Y, nrow=nlon, ncol=nlat ) G <- vector(length=L) for (l in 1:L) { G[l] <- function.F(

Re: [R] TukeyHSD and 0.0000000

2008-11-05 Thread Fredrik Karlsson
Hi, Sorry about that. Sure, here is some further information: > summary(InekeReduc) segorg intorg l2group mani score Belfast:3782 Belfast:3782 1: 2604 1 :2480 Min. : 1.000 L2 :7502 L2 :7440 2:12462 2 :2542 1st Qu.: 1.000 German :37

Re: [R] Internal and displayed precision of numbers

2008-11-05 Thread Uwe Ligges
Oliver Bandel wrote: Hello, can the displayed and/or used precision of numbers be configured? And if... how? See ?.Machine for the internally used precision. See ?options and ?format/?formatC/?print for the printed precision. Uwe Ligges Ciao, Oliver __

[R] RES: Barplot Labels Problem

2008-11-05 Thread Rodrigo Aluizio
Sorry for don't make the data available. My bad. But anyway the Richard's fourth solution works quite well. Thank you very much! Rodrigo. -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 5 de novembro de 2008 10:59 Para: Rodrigo Aluizio Cc: r

Re: [R] fine grain tick marks for zoo plots

2008-11-05 Thread tolga . i . uzuner
By way of follow-up, this will not work if the time series does not run over a year, as the replacement of January by the year fails on the second call to Axis. The following tests for this: plotmonths<-function(z,...){ plot(z,xaxt="n",...) tt <- time(z) m <- unique(as.Date(as.yearmon(tt)))

[R] lars package help!

2008-11-05 Thread CHAND SOHAIL
Hi everybody, I am trying to implement lasso using the lars package but I don't know how to extract the optimal solution. There is predict.lars function to extract the coefficients against some specified "s". I want to know how I can get the optimal choice of "lambda" i.e. the lagrange's mul

[R] Internal and displayed precision of numbers

2008-11-05 Thread Oliver Bandel
Hello, can the displayed and/or used precision of numbers be configured? And if... how? Ciao, Oliver __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] How to extract following data

2008-11-05 Thread Gabor Grothendieck
Just one comment. The code posted works as shown but if in your case Lines is actually composed of separate lines rather than one big string as in my example then you will need to add a simplify = c argument to each strapply call. On Wed, Nov 5, 2008 at 7:32 AM, Gabor Grothendieck <[EMAIL PROTECT

Re: [R] TukeyHSD and 0.0000000

2008-11-05 Thread hadley wickham
On Wed, Nov 5, 2008 at 5:42 AM, Fredrik Karlsson <[EMAIL PROTECTED]> wrote: > Dear list, > > Sorry to ask you this, but I just ran a TukeyHSD on an model with a > two thee level factors as independent variables and a numeric score > dependent variable. > The aov gives a significant interaction effe

Re: [R] Barplot Labels Problem

2008-11-05 Thread Richard . Cotton
> I’m using barplot function. I pretend to create a horizontal barplot with > two different information (side by side) for a species list. Well I can > generate the graph easily, but the problem is that the labels with the > species names are cut by device window!! I’ve tried lots of par function

Re: [R] Barplot Labels Problem

2008-11-05 Thread Duncan Murdoch
On 05/11/2008 7:16 AM, Rodrigo Aluizio wrote: Hi List, well I’ve already asked this before, but I can’t figure out a solution for the problem after trying many different ways. So I writing again… I’m using barplot function. I pretend to create a horizontal barplot with two different information

  1   2   >