search for: bkmooney

Displaying 20 results from an estimated 33 matches for "bkmooney".

2008 Nov 06
3
New to R - Errors in plotting
I am new to R and am running into trouble with the function plot. When I enter in the simple code: x<-1:4 y<-5:8 plot(x,y) I get a scatter plot with 4 points as expected. However, with my own data, A and B are both vectors of length ~85, each entry a decimal in [0,1]. Using the same plot(A,B) with this data, the plot function no longer gives me a simple plot with 85 points.
2011 Mar 18
4
Performance Difference? Windows vs. Linux
I'm not trying to start a Windows vs. Linux debate, but I've been using R on a Windows machine for a while, and was recently wondering if R's performance would be faster on a Linux machine. And similarly, if any incremental increase in processing speed would be worth the time it would take me to migrate my entire system to Linux (including a database that I access via an R package.)
2008 Dec 09
2
Applying min to numeric vectors
I was surprised this morning, that it seems as though the min() function does not work as *I* anticipated when given vector arguments. For example: a <- 1:10 b <- c(rep(1, times=5), rep(10, times=5)) Result: > min(a,b) 1 What I actually wanted was a term by term minimum, i.e.: ifelse(a<=b, a, b) 1 1 1 1 1 6 7 8 9 10 Am I losing much in terms of computation power if I use
2008 Nov 19
2
Exclude holidays in a subset of dates?
Hi All, I am iterating through dated materials, with variable start and end dates, and would like to skip procedures everytime I encounter a weekend or holiday. To do this, I thought the easiest way would be to create a TRUE/FALSE vector corresponding to each day where it is TRUE if a workday, and FALSE if a weekend or holiday. So far I have been able to do this for weekdays: startDate <-
2013 Jan 31
2
Automated Start for new Rgui within existing R code?
Is there a way to start multiple instances of R in an automated manner? Since I'm not sure that question makes tons of sense, here's my scenario: I have a number of data updates that need to be completed on an ongoing basis with the data pulled from and then stored to another location. The updates are manually triggered, so can build up in terms of the volume that needs to be updated.
2012 Jun 01
3
Add rank column to data frame as in SQL...
Hopefully this is an easy problem... I'm trying to add a partitioned rank column to a data frame where the rank is calculated separately across a partition by categories, the way you could easily do in SQL. I found this solution in the archives that looked like it might work: http://tolstoy.newcastle.edu.au/R/e11/help/10/09/8675.html The example has a data frame with several car companies,
2008 Nov 14
2
Embed SQL queries in R?
Hi All, Most of the work I am doing with R uses data which I am pulling from various SQL queries. To streamline the process even more, I was wondering if it was possible to embed SQL queries in R - that way avoiding the need to first get the data, then move to R to process it. I haven't found anything out there on this yet, so if you know of a good resource that includes this topic, I would
2008 Nov 25
1
run time function for R scripts?
Hi All, I was wondering if there was a function in R that would output the total run time for various scripts. For now I have the following workaround: begTime <- Sys.time() ... the rest of the R script... runTime <- Sys.time()-begTime Is there another function that I don't know about that would return this information in a more elegant manner? Thanks! [[alternative HTML
2008 Nov 25
1
Error in sqlCopy in RODBC
Hi All, I am trying to copy portions of tables from one SQL database to another, using sqlCopy in the RODBC package. RemoteChannel = connection to remote database LocalChannel = connection to local database LocalTable = table in my local database to receive data from the remote database query <- select query in SQL sqlCopy(RemoteChannel, query, "LocalTable",
2009 Feb 27
1
formula formatting/grammar for regression
Hi all, I am doing some basic regression analysis, and am getting a bit confused on how to enter non-polynomial formulas to be used. For example, consider that I want to find A and r such that the formula y = A*exp(r*x) provides the the best fit to the line y=x on the interval [0,50]. I can set: xpts <- seq(0, 50, by=0.1) ypts <- seq(0, 50, by=0.1) I know I can find a fitted polynomial
2009 May 20
1
efficiency when processing ordered data frames
Hoping for a little insight into how to make sure I have R running as efficiently as possible. Suppose I have a data frame, A, with n rows and m columns, where col1 is a date time stamp. Also suppose that when this data is imported (from a csv or SQL), that the data is already sorted such that the time stamp in col1 is in ascending (or descending) order. If I then wanted to select only the rows
2009 Jan 16
2
Missing file to run Rcmd batch on Windows
Hi, I'm trying to run an R script using Rcmd Batch from the command line on a Windows Vista machine. I am using R version 2.8.1. I installed the batch files 4-3 found at http://cran.r-project.org/contrib/extra/batchfiles/ and added them to my path. I also had to install the latest version of perl (it's Strawberry perl if that makes a difference) and have added this to my path. Now when
2009 Jul 23
1
Activation Functions in Package Neural
Hi, I am trying to build a VERY basic neural network as a practice before hopefully increasing my scope. To do so, I have been using package "neural" and the MLP related functions (mlp and mlptrain) within that package. So far, I have created a basic network, but I have been unable to change the default activation function. If someone has a suggestion, please advise. The goal of the
2012 Oct 10
3
Numeric "Label" of Factor value?
Sorry, I'm sure I'm not using the appropriate vocab here, which is undoubtedly why I can't seem to find a fix to this (hopefully very easy) problem. Suppose you have a factor abc <- factor(c(2,2,3,4,7,7)) And you want to know what the number in the nth spot in that would be abc[1] [1] 2 Levels: 2 3 4 7 shows the correct label of the first element - but if I want to pull out the
2008 Dec 12
1
Avoiding multiple outputs using RODBC package
I am using R as a data manipulation tool for a SQL database. So in some of my R scripts I use the RODBC package to retreive data, then run analysis, and use the sqlSave function in the RODBC package to store the results in a database. There are two problems I want to avoid, and they are highly related: (1) having R rerun analysis which has already been done and saved into output database table,
2011 Apr 06
3
Decimal Accuracy Loss?
This is hopefully a quick question on decimal accuracy. Is any decimal accuracy lost when casting a numeric vector as a matrix? And then again casting the result back to a numeric? I'm finding that my calculation values are different when I run for loops that manually calculate matrix multiplication as compared to when I cast the vectors as matrices and multiply them using "%*%".
2009 Jan 21
3
Error as.Date on Invalid Dates
Hi All, I have an script in R which accepts user inputs for certain parameters, particularly dates, which the user inputs as character strings. eg: > date1 <- "2009-01-21" The script later parses the input via the as.Date function: > as.Date(date1) However, as.Date encounters an error when the string does not represent an actual date. eg: > date1 <-
2009 Jan 13
2
Memory Size & Allocation in R
My apologies if this is a bit of a 'newbie' question. I am using R v 2.8.0 in Windows and am a bit confused about the memory size/allocation. A script I wrote faulted out with the error: "Error: cannot allocate vector of size 5.6 Mb" After this error, I still have: > memory.size() [1] 669.3517 > memory.limit() [1] 1535.875 Since the memory size is well under 5.6Mb less
2009 Feb 17
6
Percentiles/Quantiles with Weighting
Hi All, I am looking at applications of percentiles to time sequenced data. I had just been using the quantile function to get percentiles over various periods, but am more interested in if there is an accepted (and/or R-implemented) method to apply weighting to the data so as to weigh recent data more heavily. I wrote the following function, but it seems quite inefficient, and not really very
2008 Dec 29
0
Serial Correlation Test for Short Time Series
...E+00 2.4000E-02 4.7881E+02 > > ... > > ... > > ... > > > > zheng > > > > > > -- Sarah Goslee http://www.functionaldiversity.org ------------------------------ Message: 26 Date: Mon, 22 Dec 2008 15:20:18 -0500 From: "Brigid Mooney" <bkmooney at gmail.com> Subject: [R] How can I avoid nested 'for' loops or quicken the process? To: r-help at r-project.org Message-ID: <85f3856f0812221220s9d936e8y5f9034c3584c3fc6 at mail.gmail.com> Content-Type: text/plain Hi All, I'm still pretty new to using R - and I was hoping...