[R] newbie question on importing and parsing file by row

2010-11-05 Thread Emily Wong
Hi, I'm new to R and I have a file with many rows of values. Each row contains a title and values for a contingency table e.g. row 1= title8 0 37796 47 which is a table called 'title' with values 8 0 37796 47 I would like to know how I can import this using R and for each

Re: [R] Regular Expressions

2010-11-05 Thread Prof Brian Ripley
On Thu, 4 Nov 2010, Noah Silverman wrote: Hi, I'm trying to figure out how to use capturing parenthesis in regular expressions in R. (Doing this in Perl, Java, etc. is fairly trivial, but I can't seem to find the functionality in R.) For example, given the string:"10 Nov 13.00 (PFE1020

Re: [R] Regular Expressions

2010-11-05 Thread Noah Silverman
That's perfect! Don't know how I missed that. I want to start playing with some modeling of financial data and the only format I can download is rather ugly. So my plan is to use a series of Regex to extract what I want. Noticed that you are a Prof. in applied stats. I'm at UCLA working on an

Re: [R] newbie question on importing and parsing file by row

2010-11-05 Thread Gerrit Eichner
Hello, Emily, take a look at read.table() for importing (with or without header depending on your file which holds the data). Maybe X <- read.table( "yourfilename", header = FALSE, row.names = 1) and then pvalues <- apply( X, 1, function( x) fisher.test(

Re: [R] NFFT on a Zoo?

2010-11-05 Thread Bob Cunningham
FWIW: It turns out I dove into a rabbit hole: 1. Though the gaps in my 3-axis accelerometer data represent 10% data loss (OMG!), the number of gaps represents only 0.1% of the 3 million data points (BFD). 2. The data is noisy enough that 0.1% discontinuity can't affect an FFT. Each gap was

[R] Detect the Warning Message

2010-11-05 Thread Yen Lee
Dear all, I've written a function and repeated it for 5000 times with loops with different value, and the messages returned are the output I set and 15 warnings. I would like to trace the warnings by stopping the loop when warning came out. Does anyone know how to make it? Thanks a lot fo

[R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
Hi folks, (Learning R) 5.1 Arrays http://cran.r-project.org/doc/manuals/R-intro.html#Vectors-and-assignment 1) If continued on previous example (3.1 Intrinsic attributes: mode and length), > z <- 0:9 > dim(z) <- c(3,5,100) Error in dim(z) <- c(3, 5, 100) : dims [product 1500] do not match th

Re: [R] (no subject)

2010-11-05 Thread Michael Bedward
Hello, One approach would be to fit your distribution using MCMC with, for example, the rjags package. Then you can use the "zeroes trick" or "ones trick" to implement your new distribution as described here... http://mathstat.helsinki.fi/openbugs/data/Docu/Tricks.html You will find a summary of

Re: [R] Ordinal response model in depmixS4

2010-11-05 Thread Ingmar Visser
Penny, The ?makeDepmix page has an example of how to add your own response distribution model. hth, Ingmar On Fri, Oct 22, 2010 at 3:08 PM, Penny Adversario wrote: > I am running a latent class regression with 3 nominal and 2 ordinal > variables using depmixS4 but the available response models d

[R] as.xts

2010-11-05 Thread spela podgorsek
hey I am trying to turn a dataframe into xts with the function: as.xts, but it returns the error: Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format could someone give me some pointers please the data is coming from a spreadsheet via the excel,

[R] table with values as dots in increasing sizes

2010-11-05 Thread fugelpitch
I was just thinking of a way to present data and if it is possible in R. I have a data frame that looks as follows (this is just mockup data). df location,"species1","species2","species3","species4","species5" "loc1",0.44,0.28,0.37,-0.24,0.41 "loc2",0.54,0.62,0.34,0.52,0.71 "loc3",-0.33,0.75,-0.

Re: [R] About 5.1 Arrays

2010-11-05 Thread Gerrit Eichner
On Fri, 5 Nov 2010, Stephen Liu wrote: [snip] "0" is counted as 1 object. Of course! It is a number like any other. Does "object length" mean the total number of objects/entries? Yes. Please help me to understand follow; "For example if the dimension vector for an array, say a, is c(3,4

Re: [R] table with values as dots in increasing sizes

2010-11-05 Thread ONKELINX, Thierry
> install.packages("fortunes") > library(fortunes) > fortune("yoda") Evelyn Hall: I would like to know how (if) I can extract some of the information from the summary of my nlme. Simon Blomberg: This is R. There is no if. Only how. -- Evelyn Hall and Simon 'Yoda' Blomberg R-help (April 20

Re: [R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
Hi Gerrit, Thanks for your advice. - snip - > A[i, j, k] is the value of the element in position (i,j,k) of array A. In > other words, it is the entry in row i, column j, and "layer" k (if one > wants to think of A as a cuboidal grid). Sorry I can't follow. Could you pls explain in more d

[R] ANOVA table and lmer

2010-11-05 Thread ian m s white
Like James Booth, I find the SSQ and MSQ in lmer output confusing. The F-ratio (1.485) for Variety is the same for aov, lme and lmer, but lmer's mean square for variety is 1.485 times the subplot residual mean square. In the conventional anova table for a split-plot expt, the variety mean square is

[R] filled.contour colorbar without black color separators?

2010-11-05 Thread Gregor Volberg
Dear list members, I have been using filled.contour in order to plot EEG data. For the colors, I used a conventional ramp from blue to red (blue - green - yellow - red), and 100 color levels to make the plot looking smooth: (...) color.palette = colorRampPalette(c('blue','green', 'yellow','

Re: [R] table with values as dots in increasing sizes

2010-11-05 Thread Gabor Grothendieck
On Fri, Nov 5, 2010 at 4:45 AM, fugelpitch wrote: > > I was just thinking of a way to present data and if it is possible in R. > > I have a data frame that looks as follows (this is just mockup data). > > df > location,"species1","species2","species3","species4","species5" > "loc1",0.44,0.28,0.37,

[R] RBloomberg on R-2.12.0

2010-11-05 Thread Tolga I Uzuner
Dear R Users, Tried to install RBloomberg with R-2.12.0 and appears RDComclient has not been built for this version of R, so failed. I then tried to get RBloombergs' Java API version to work, but ran into problems with RJava which does not appear to exist for Windows. My platform is Windows XP

Re: [R] Memory Management under Linux

2010-11-05 Thread jim holtman
It would be very useful if you would post some information about what exactly you are doing. There si something with the size of the data object you are processing ('str' would help us understand it) and then a portion of the script (both before and after the error message) so we can understand th

Re: [R] ANOVA table and lmer

2010-11-05 Thread Dennis Murphy
Hi: Look at the structure of the experiment. The six blocks represent different replications of the experiment. No treatment is assigned at the block level. Within a particular block, there are three plots, to which each variety is randomly assigned to one of them. Ideally, separate randomization

Re: [R] Detect the Warning Message

2010-11-05 Thread jim holtman
?options and then you will find the following: warn: sets the handling of warning messages. If warn is negative all warnings are ignored. If warn is zero (the default) warnings are stored until the top–level function returns. If fewer than 10 warnings were signalled they will be printed otherwise

Re: [R] filled.contour colorbar without black color separators?

2010-11-05 Thread David Winsemius
On Nov 5, 2010, at 7:36 AM, Gregor Volberg wrote: Dear list members, I have been using filled.contour in order to plot EEG data. For the colors, I used a conventional ramp from blue to red (blue - green - yellow - red), and 100 color levels to make the plot looking smooth: (...) color.p

Re: [R] postForm() in RCurl and library RHTMLForms

2010-11-05 Thread Duncan Temple Lang
On 11/4/10 11:31 PM, sayan dasgupta wrote: > Thanks a lot thats exactly what I was looking for > > Just a quick question I agree the form gets submitted to the URL > "http://www.nseindia.com/marketinfo/indices/histdata/historicalindices.jsp"; > > and I am filling up the form in the page > "http

Re: [R] RBloomberg on R-2.12.0

2010-11-05 Thread Duncan Temple Lang
On 11/5/10 5:20 AM, Tolga I Uzuner wrote: > Dear R Users, > > Tried to install RBloomberg with R-2.12.0 and appears RDComclient has not > been built for this version of R, so failed. I then tried to get RBloombergs' > Java API version to work, but ran into problems with RJava which does not >

Re: [R] NFFT on a Zoo?

2010-11-05 Thread Mike Marchywka
> Date: Fri, 5 Nov 2010 00:14:15 -0700 > From: flym...@gmail.com > To: marchy...@hotmail.com > CC: ggrothendi...@gmail.com; r-help@r-project.org; > rpy-l...@lists.sourceforge.net > Subject: Re: [R] NFFT on a Zoo? > > FWIW: It turns out I dove into a r

Re: [R] About 5.1 Arrays

2010-11-05 Thread Steve Lianoglou
Hi, On Fri, Nov 5, 2010 at 6:00 AM, Stephen Liu wrote: [snip] >> A[i, j, k] is the value of the element in position (i,j,k) of array A. In >> other words, it is the entry in row i, column j, and "layer" k (if one >> wants to think of A as a cuboidal grid). > > Sorry I can't follow.  Could you pls

[R] About installing RBloomberg

2010-11-05 Thread Stephen Liu
Hi folks, Debian 600 64bit desktop > sudo R Password: > install.packages("RBloomberg", repos="http://R-Forge.R-project.org";) * DONE (zoo) ERROR: dependencies ‘rcom’, ‘bitops’, ‘RUnit’ are not available for package ‘RBloomberg’ * removing ‘/usr/local/lib/R/site-library/RBloomberg’ Fai

Re: [R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
Hi Steve, > It's not clear what you're having problems understanding. By > setting the "dim" attribute of your (1d) vector, you are changing > itsdimenensions. I'm following An Introduction to R to learn R On 5.1 Arrays http://cran.r-project.org/doc/manuals/R-intro.html#Vectors-and-assignment

[R] Extracting data only for particular index values from a zoo structure

2010-11-05 Thread Santosh Srinivas
Hello All, I have a zoo structure as follows: > dput(tMRet) structure(c(0.00138742474397713, -0.0309023681475112, 0.0390276302410908, 0.0832282874685357, -0.00315002033871414, -0.0158548785709138, -0.0410876001496389, -0.0503189291168807, 0.00229628598547049, 0.112348434473647, 0.07600046962546

[R] improve R memory under linux

2010-11-05 Thread ricardo souza
Dear all, I am using ubuntu linux 32 with 4 Gb.  I am running a very small script and I always got the same error message:  CAN NOT ALLOCATE A VECTOR OF SIZE 231.8 Mb. I have reading carefully the instruction in ?Memory.  Using the function gc() I got very low numbers of memory (please sea belo

Re: [R] Extracting data only for particular index values from a zoo structure

2010-11-05 Thread Gabor Grothendieck
On Fri, Nov 5, 2010 at 11:21 AM, Santosh Srinivas wrote: > Hello All, > > I have a zoo structure as follows: >> dput(tMRet) > structure(c(0.00138742474397713, -0.0309023681475112, 0.0390276302410908, > 0.0832282874685357, -0.00315002033871414, -0.0158548785709138, > -0.0410876001496389, -0.0503189

Re: [R] About 5.1 Arrays

2010-11-05 Thread Steve Lianoglou
Hi, On Fri, Nov 5, 2010 at 10:56 AM, Stephen Liu wrote: > Hi Steve, > >> It's not clear what you're having problems understanding. By >> setting the "dim" attribute of your (1d) vector, you are changing >> itsdimenensions. > > I'm following An Introduction to R to learn R > > On > > 5.1 Arrays >

[R] boot.stepAIC NA values

2010-11-05 Thread Martin McCabe
Hi. I have a coxph model of variables linked to survival in medulloblastoma. The data were collated from various publications and not all authors quoted all variables. I'd like to internally validate the model and have tried bootstrapping it using boot.stepAIC but it fails because of th

Re: [R] improve R memory under linux

2010-11-05 Thread Jonathan P Daily
A "very small script" should fit just fine in an email: what are you trying to do? Likely, you are assigning many small variables in some loop. Even if you have 4GB of RAM available, if R assigns 3.99 GB of it and then then a call comes in to assign something of size .02, it will tell you it ca

Re: [R] About 5.1 Arrays

2010-11-05 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Stephen Liu > Sent: Friday, November 05, 2010 7:57 AM > To: Steve Lianoglou > Cc: r-help@r-project.org > Subject: Re: [R] About 5.1 Arrays > > Hi Steve, > > > It's not clear what

Re: [R] Extracting data only for particular index values from a zoo structure

2010-11-05 Thread Santosh Srinivas
Thanks Gabor for pointing in the right direction. Looked up cycle and the doc is tough to understand " cycle gives the positions in the cycle of each observation." ... how is cycle defined. I just extended your idea to make it readable for an avg. user in the following way mRet[format(index(mRet),

Re: [R] as.xts

2010-11-05 Thread Joshua Wiley
Hi Ela, as.xts() calls as.POSIXlt() to convert the dates to a date/time class. Evidently, the the column that contains your times is not "unambiguous" to POSIX, that is, the format is not clear. It is really impossible to give you much more advice without having some sample data or what you actu

Re: [R] Extracting data only for particular index values from a zoo structure

2010-11-05 Thread Gabor Grothendieck
On Fri, Nov 5, 2010 at 11:54 AM, Santosh Srinivas wrote: > Thanks Gabor for pointing in the right direction. > Looked up cycle and the doc is tough to understand " cycle gives the > positions in the cycle of each observation." ... how is cycle defined. > > I just extended your idea to make it read

Re: [R] how to work with long vectors

2010-11-05 Thread Changbin Du
HI, Phil, I used the following codes and run it overnight for 15 hours, this morning, I stopped it. It seems it is still not efficient. > matt<-read.table("/house/groupdirs/genetic_analysis/mjblow/ILLUMINA_ONLY_MICROBIAL_GENOME_ASSEMBLY/4083340/STANDARD_LIBRARY/GWZW.994.5.1129.trim_69.fastq.1962

Re: [R] About 5.1 Arrays

2010-11-05 Thread Stephen Liu
Hi Daniel, Thanks for your detail advice. I completely understand your explain. But I can't resolve what does "a" stand for there? a[1,1,1] is 1 * 1 * 1 = 1 a[2,1,1] is 2 * 1 * 1 = 2 a[2,4,2] is 2 * 4 * 2 = 16 a[3,4,2] is 3 * 4 * 2 = 24 ? B.R. Stephen L - Original Message Fro

[R] How to extract particular rows and column from a table

2010-11-05 Thread Mauluda Akhtar
Hello, I'm a new user of R. I've a very big table like the following structure (suppose the variable name with "aa"). From this table I want to make a new table which'll contain just two column with V2 and V6 with some particular rows( Suppose, variable name with "bb"). I'd like to mention V2 colum

Re: [R] how to work with long vectors

2010-11-05 Thread Martin Morgan
On 11/05/2010 09:13 AM, Changbin Du wrote: > HI, Phil, > > I used the following codes and run it overnight for 15 hours, this morning, > I stopped it. It seems it is still not efficient. > > >> > matt<-read.table("/house/groupdirs/genetic_analysis/mjblow/ILLUMINA_ONLY_MICROBIAL_GENOME_ASSEMBLY/4

Re: [R] how to work with long vectors

2010-11-05 Thread Martin Morgan
On 11/05/2010 09:42 AM, Martin Morgan wrote: > ## first time only > source("http://bioconductor.org";) oops, source("http://bioconductor.org/biocLite.R";) > biocLite("IRanges") > > ## > library(IRanges) > contigs = IRanges(start=1, width=matt$reads) > cvg = coverage(contigs) ## an RLE summarizi

Re: [R] About 5.1 Arrays

2010-11-05 Thread Joshua Wiley
On Fri, Nov 5, 2010 at 9:17 AM, Stephen Liu wrote: > Hi Daniel, > > Thanks for your detail advice.  I completely understand your explain. > > But I can't resolve what does "a" stand for there? the "a" just represents some vector. It is the name of the object that stores your data. Like you migh

Re: [R] About 5.1 Arrays

2010-11-05 Thread RICHARD M. HEIBERGER
Continuing with Daniel's example, but with different data values a <- sample(24) a dim(a) <- c(3,4,2) a as.vector(a) ## for an array with ## dim(a) == c(3,4,2) ## a[i,j,k] means select the element in position ##i + (j-1)*3 + (k-1)*3*4 index <- function(i,j,k) { i + (j-1)*3 + (k-1)*3*4 }

Re: [R] how to work with long vectors

2010-11-05 Thread Changbin Du
Thanks Martin! I will try it and will let your guys know how it goes. On Fri, Nov 5, 2010 at 9:42 AM, Martin Morgan wrote: > On 11/05/2010 09:13 AM, Changbin Du wrote: > > HI, Phil, > > > > I used the following codes and run it overnight for 15 hours, this > morning, > > I stopped it. It seems

Re: [R] how to work with long vectors

2010-11-05 Thread William Dunlap
The following cover_per_3 uses sorting to solve the problem more quickly. It still has room for improvement. cover_per_3 <- function (data) { n <- length(data) o <- rev(order(data)) sdata <- data[o] r <- rle(sdata)$lengths output <- numeric(n) output[o] <- rep(cumsum(r),

Re: [R] How to extract particular rows and column from a table

2010-11-05 Thread Mike Rennie
Hi Mauluda, Next time, please read the posting guide- helping you is made alot easier if you provide the code that didn't work. It sounds like you might want something like this? #make a data frame, with some column names assigned... aa<-data.frame(c(rep("a",5), rep("c",3)),c(rep(7,5), rep(2,3))

Re: [R] how to work with long vectors

2010-11-05 Thread Changbin Du
Thanks, William. It gave me a lesson. On Fri, Nov 5, 2010 at 9:58 AM, William Dunlap wrote: > The following cover_per_3 uses sorting to solve > the problem more quickly. It still has room > for improvement. > > cover_per_3 <- function (data) > { >n <- length(data) >o <- rev(order(data)

Re: [R] how to work with long vectors

2010-11-05 Thread William Dunlap
There was a numerical typo below, I said the sample sizes were 5 and 10 thousand, I should have said 10 and 20 thousand (the size argument to sample()). Also, I timed cover_per_2 and _3 for size 200,000 and gots times of 338 and 0.12 seconds, respectively. Growing the problem by a factor to 10 ma

Re: [R] Loop

2010-11-05 Thread Matevž Pavlič
Hi Jim an Petr, Both of your solutions do what i want. Thanks for the help, Regards, m -Original Message- From: Petr PIKAL [mailto:petr.pi...@precheza.cz] Sent: Friday, November 05, 2010 6:49 AM To: Matevž Pavlič Cc: jim holtman; r-help@r-project.org Subject: RE: [R] Loop Hi the lis

Re: [R] Regular Expressions

2010-11-05 Thread Brian Diggs
On 11/5/2010 12:09 AM, Prof Brian Ripley wrote: On Thu, 4 Nov 2010, Noah Silverman wrote: Hi, I'm trying to figure out how to use capturing parenthesis in regular expressions in R. (Doing this in Perl, Java, etc. is fairly trivial, but I can't seem to find the functionality in R.) For example

Re: [R] Regular Expressions

2010-11-05 Thread Gabor Grothendieck
2010/11/5 Brian Diggs : > Is there a standard, built in way to get both (all) backreferences at the > same time with just one call to sub (or the appropriate function)? I can > cobble something together specifically for 2 backreferences (not extensively > tested): > > both_backrefs <- function(patt

[R] data acquisition with R?

2010-11-05 Thread B.-Markus Schuller
Hello, I spent quite some time now searching for any hint that R can also be used to address the interfaces of a computer (i.e. RS232 or USB) to acquire data from measurement devices (like with the - I think it is the - devices or serial toolbox of Matlab). Is there any package available or

Re: [R] R-help Digest, Vol 93, Issue 5

2010-11-05 Thread Joshua Ulrich
On Fri, Nov 5, 2010 at 6:00 AM, wrote: > Send R-help mailing list submissions to >        r-h...@r-project.org > > To subscribe or unsubscribe via the World Wide Web, visit >        https://stat.ethz.ch/mailman/listinfo/r-help > or, via email, send a message with subject or body 'help' to >      

[R] X11 and pdf differences

2010-11-05 Thread statquant2
Hi guys, I have the following problem : when plooting using the X11() device, the output I get is different from the output I get when I use pdf(). For instance the title font size in a pdf seems to be proportionnaly bigger that in a x11... I tryed to set pdf.options() egal to x11.options(), but

[R] subsets, %in%

2010-11-05 Thread MP . Sylvestre
Hi, I have a question about %in% and subsettin data frames. Say I need to keep ID 1,2,4,5, 10 from the data frame dat. I can do: dat <- data.frame(ID = 1:10, var = 1:10) someID <- c(1,2,4,5,10) subset(dat, dat$ID %in% someID) Is there a quick way to do the opposite, ie to do a subset that conta

[R] How to extract Friday data from daily data.

2010-11-05 Thread thornbird
I am new to Using R for data analysis. I have an incomplete time series dataset that is in daily format. I want to extract only Friday data from it. However, there are two problems with it. First, if Friday data is missing in that week, I need to extract the data of the day prior to that Friday

Re: [R] subsets, %in%

2010-11-05 Thread Erik Iverson
Well, %in% returns a logical vector... So subset(dat, ! ID %in% someID) Also, from ?subset: Note that ‘subset’ will be evaluated in the data frame, so columns can be referred to (by name) as variables in the expression Thus, you don't need 'dat$ID', bur just 'ID' in the subset argum

Re: [R] subsets, %in%

2010-11-05 Thread Jonathan P Daily
Any logical value can be negatively compared using ! does: subset(dat, !(dat$ID %in% someID)) provide what you need? -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room

Re: [R] subsets, %in%

2010-11-05 Thread Jorge Ivan Velez
Hi MP, Try subset(dat, ! dat$ID %in% someID) # ! symbol HTH, Jorge On Fri, Nov 5, 2010 at 10:13 AM, <> wrote: > Hi, > > I have a question about %in% and subsettin data frames. > > Say I need to keep ID 1,2,4,5, 10 from the data frame dat. I can do: > > dat <- data.frame(ID = 1:10, var = 1:10)

Re: [R] subsets, %in%

2010-11-05 Thread Seeliger . Curt
> Say I need to keep ID 1,2,4,5, 10 from the data frame dat. I can do: > dat <- data.frame(ID = 1:10, var = 1:10) > someID <- c(1,2,4,5,10) > subset(dat, dat$ID %in% someID) > Is there a quick way to do the opposite ... > Two operators spring to mind: ! and %nin subset(dat, !(dat$ID %in% so

[R] improve R memory under linux

2010-11-05 Thread ricardo souza
Dear Jonathan, It is not small,  I passed the wrong information.  I am running a geostatistic analysis with geoR that is computational intense. At the end my analysis I call the function krige.control and krige.conv.  However, what call my attention is that I have a friend that was able to run

Re: [R] Memory Management under Linux

2010-11-05 Thread ricardo souza
Dear Jim, Thanks for your attention. I am running a geostatistic analysis with geoR that is computational intense. At the end my analysis I call the function krige.control and krige.conv.  Do you have any idea how to improve the memory allocation in Linux? Thanks, Ricardo De: jim holtman A

[R] connecting to remote database using RMySQL

2010-11-05 Thread Jan Theodore Galkowski
Apologies if this is the wrong place to ask. I'm not aware of a mail list devoted to database interfaces. Please direct me if so. I am trying to use TSMySQL. It loads RMySQL, and apparent the CRAN version has an .onLoad script which seeks out the local MySQL server. If that fails, the package f

Re: [R] connecting to remote database using RMySQL

2010-11-05 Thread Henrique Dallazuanna
library(RMySQL) conn <- dbConnect(MySQL(), user = 'user', password = 'password', host = ' your_host.com') Look at http://biostat.mc.vanderbilt.edu/RMySQL for more information On Fri, Nov 5, 2010 at 5:04 PM, Jan Theodore Galkowski < bayesianlo...@acm.org> wrote: > Apologies if this is the wrong p

Re: [R] connecting to remote database using RMySQL

2010-11-05 Thread Jan Theodore Galkowski
Yes, what happens when I do that is: R version 2.11.1 (2010-05-31) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 [snip] > Sys.getenv("MYSQL_USER") MYSQL_USER "mf1" > # As an example. Other env vars are defined. > library(RMySQL) Loading required package: DBI Erro

Re: [R] How to extract Friday data from daily data.

2010-11-05 Thread Adrienne Wootten
Hey, This should work, but after you read in your data make sure that your day, date and time are separate, this should work just fine, or something like it. > testdata views number timestamp day date time 1 views 910401 1246192687 Sun 6/28/2009 12:38 2 views 921537 124627891

Re: [R] connecting to remote database using RMySQL

2010-11-05 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Jan Theodore Galkowski > Sent: Friday, November 05, 2010 12:05 PM > To: R Project > Subject: [R] connecting to remote database using RMySQL > > Apologies if this is the wrong plac

Re: [R] data acquisition with R?

2010-11-05 Thread Matt Shotwell
R implements (almost) all IO through its 'connections'. Unfortunately, there is no API (public or private) for adding connections, and therefore no packages that implement connections. You will find more discussion of connections and hardware (serial, USB) interface in the R-devel list archives. T

[R] assignment operator saving factor level as number

2010-11-05 Thread Wade Wall
Hi all, I have a dataframe (df1) that I am trying to select values from to a second dataframe that at the current time is only for the selected items from df1 (df2). The values that I am trying to save from df1 are factors with alphanumeric names df1 looks like this: 'data.frame': 3014 obs. o

Re: [R] assignment operator saving factor level as number

2010-11-05 Thread Erik Iverson
Could you give a small reproducible example please? It is not clear to me what your looping structure is doing, or what your goal here is. There may be a much simpler method than introducing subscripts. --Erik Wade Wall wrote: Hi all, I have a dataframe (df1) that I am trying to select values

Re: [R] assignment operator saving factor level as number

2010-11-05 Thread jim holtman
Your example looks like you are assigning back to the first column of df2 (Num). Is this what you are really doing in your code? You need to follow the posting guide: PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, repr

Re: [R] assignment operator saving factor level as number

2010-11-05 Thread Jeffrey Spies
Perhaps this will help: > test1 <- test2 <- data.frame(col1=factor(c(1:3), labels=c("a", "b", "c"))) > test3 <- data.frame(col1 = 1:3) Now: > test2[2,1] <- test1$col1[1] > test2$col1 [1] a a c Levels: a b c vs > test3[2,1] <- test1$col1[1] > test3$col1 [1] 1 1 3 Because test3's first column,

Re: [R] Memory Management under Linux

2010-11-05 Thread jim holtman
I would do some monitoring (debugging) of the script by placing some 'gc()' calls in the sequence of statements leading to the problem to see what the memory usage is at that point. Take a close look at the sizes of your objects. If it is happening in some function you have called, you may have t

Re: [R] assignment operator saving factor level as number

2010-11-05 Thread Jorge Ivan Velez
Hi Wade, Try (untested): df2[j,1] <- as.character(f2$Site)[i] If that does not work, which is very likely, could you please provide commented, minimal, self-contained, reproducible code? HTH, Jorge On Fri, Nov 5, 2010 at 3:54 PM, Wade Wall <> wrote: > Hi all, > > I have a dataframe (df1) tha

[R] Problem with 'lars' package

2010-11-05 Thread Vladimir Subbotin
Hello, I have problems with 'lars' package. I found the previous post of the person who had the same issue, but the suggested solution in that post did not help me. I created the matrices: ResponseMatrix <- data.frame (GAOdecision=GAOdecision) PredictorsMatrix <- data.frame (WeaponvsNon = Weapon

[R] Visualisation of data structures

2010-11-05 Thread Friedericksen Hope
Hi everyone, I wonder if there is a package or functions to visualize data structures in R? For example I have a list with a lot of data frames - is there a function which plots the elements of the list? Thanks! Best, Friedericksen __ R-help@r-proje

Re: [R] How to extract Friday data from daily data.

2010-11-05 Thread thornbird
Thank you very much. It worked great with the testdata. I have one more questionto to ask. As my data is incomplete, sometimes Thu is also missing, then I have no other options but to pick Sat instead, and if Sat is also missing, then my best possible option is to pick Wed, and etc. Bascially I ha

Re: [R] Visualisation of data structures

2010-11-05 Thread Greg Snow
There is the TkListView function in the TeachingDemos package for looking at list structures. It gives you a view of the list structure with nested elements available to be expanded by clicking on the little plus sign. You can view or run code on the selected piece, which could help create som

Re: [R] Problem with 'lars' package

2010-11-05 Thread Steve Lianoglou
Hi, On Fri, Nov 5, 2010 at 4:14 PM, Vladimir Subbotin wrote: > Hello, > > I have problems with 'lars' package. I found the previous post of the person > who had the same issue, but the suggested solution in that post did not help > me. > > I created the matrices: > > ResponseMatrix <- data.frame

Re: [R] assignment operator saving factor level as number

2010-11-05 Thread Wade Wall
Hi all, Thanks for the help. Jeffrey was right; my initial dataframe did not have the columns defined for factors. I solved it using Jorge's example of using as.character. Sorry for not being more clear before. Wade On Fri, Nov 5, 2010 at 4:12 PM, Jeffrey Spies wrote: > Perhaps this will he

[R] Spatstat rmh function error message

2010-11-05 Thread Neba Funwi-Gabga
Hello, I have fitted a Poisson Process model in spatstat using >fit1<-ppm(points, ~elevation, covariates=list(elevation=elevation.im)) This far, everything went well, but I try to simulate the fitted model using the function: >sim1<-rmh(fit1) But I get the error message: "Extracting model infor

Re: [R] How to extract Friday data from daily data.

2010-11-05 Thread Gabor Grothendieck
On Fri, Nov 5, 2010 at 1:22 PM, thornbird wrote: > > I am new to Using R for data analysis. I have an incomplete time series > dataset that is in daily format. I want to extract only Friday data from it. > However, there are two problems with it. > > First, if Friday data is missing in that week,

[R] variable type assignment in daisy

2010-11-05 Thread Penny Adversario
Dear Rhelp,   I did a daisy on 5 lifestyle variables, 3 of which were nominal and 2 were ordinal and assigned types “nominal” and “ordinal” for the variables, respectively.  I got an output indicating their types as “I” for interval(?). Doing it on the Rdata example “flower” ga

[R] prob with legend in my plots!

2010-11-05 Thread govindas
Hi, I have a problem with the appearance of legend in my plots. If I specify the legend positions in characters like "topright"..etc, it appears, if i specify it in terms of coordinates like "-1, 1" .. etc, it does not appear. Can anyone help me with this? script - x.date <- as.Date(past

Re: [R] How to extract Friday data from daily data.

2010-11-05 Thread Gabor Grothendieck
On Fri, Nov 5, 2010 at 8:24 PM, Gabor Grothendieck wrote: > On Fri, Nov 5, 2010 at 1:22 PM, thornbird wrote: >> >> I am new to Using R for data analysis. I have an incomplete time series >> dataset that is in daily format. I want to extract only Friday data from it. >> However, there are two prob

Re: [R] prob with legend in my plots!

2010-11-05 Thread David Winsemius
On Nov 5, 2010, at 6:59 PM, govin...@msu.edu wrote: Hi, I have a problem with the appearance of legend in my plots. If I specify the legend positions in characters like "topright"..etc, it appears, if i specify it in terms of coordinates like "-1, 1" .. etc, it does not appear. Is -

[R] slow dget

2010-11-05 Thread Jack Tanner
I have a data structure that is fast to dput(), but very slow to dget(). On disk, the file is about 35MB. > system.time(dget("r.txt")) user system elapsed 142.931.27 192.84 The same data structure is fast to save() and fast to load(). The .RData file on disk is about 12MB. > system.t

Re: [R] assignment operator saving factor level as number

2010-11-05 Thread Jeffrey Spies
Glad you figured it out, but just be aware that if you set one value of the column to be a character, it will make the whole vector characters. This could cause issues for analysis if you need numerics or factors. If the column is supposed to be a factor to begin with, set it to be so; if you hav

[R] calcute probability

2010-11-05 Thread Jumlong Vongprasert
Dear All -- Jumlong Vongprasert Assist, Prof. Institute of Research and Development Ubon Ratchathani Rajabhat University Ubon Ratchathani THAILAND 34000 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.eth

[R] calculate probability

2010-11-05 Thread Jumlong Vongprasert
Dear All I have 2 value assume 2.4 and 2.9 and mean = 2 variance = with n = 10 I want to find probability = 2.4 and 2.9. How I can do this. Many Thanks. Jumlong -- Jumlong Vongprasert Assist, Prof. Institute of Research and Development Ubon Ratchathani Rajabhat University Ubon Ratchathani THAILAN

Re: [R] calculate probability

2010-11-05 Thread Joshua Wiley
Dear Jumlong, Perhaps look at ?pnorm I am not really certain what you want to do. Are 2.4 and 2.9 scores or means? Is the variance 2? What distribution are you assuming these values come from? If you explain a bit more what you are after, we can help more. Cheers, Josh On Fri, Nov 5, 2010

Re: [R] calculate probability

2010-11-05 Thread Joshua Wiley
Hi Jumlong, Is this what you want? > pnorm(q = c(2.4, 2.9), mean = 2, sd = 1) [1] 0.6554217 0.8159399 HTH, Josh On Fri, Nov 5, 2010 at 9:57 PM, Jumlong Vongprasert wrote: > Dear Joshua Wiley > 2.4 and 2.9 are score, and mean = 2 variance = 1 n = 10 with normal > distribution. > Many Thanks.

Re: [R] slow dget

2010-11-05 Thread jim holtman
dput/dget were not intended to save/restore large objects. Understand what is happening in the use of dput/dget. dput is creating a text file that can reconstitute the object with dget. dget is having to read the file in and then parse it: > dget function (file) eval(parse(file = file)) This