Displaying 20 results from an estimated 10000 matches similar to: "errors when trying to rename data frame columns"
2005 Jan 11
5
global objects not overwritten within function
Dear useRs,
I have a function that creates several global objects with
assign("obj",obj,.GlobalEnv), and which I need to run iteratively in
another function. The code is similar to
f <- function(...) {
assign("obj",obj,.GlobalEnv)
}
fct <- function(...) {
for (i in 1:1000)
{
...
f(...)
...obj...
rm(obj) #code fails without this line
}
}
I don't understand
2004 Oct 11
5
read "4-jan-02" as date
Dear R users,
I have a column with dates (character) in a data frame:
12-Jan-01 11-Jan-01 10-Jan-01 9-Jan-01 8-Jan-01 5-Jan-01
and I need to convert them to (Julian) dates so that I can
sort the whole data frame by date. I thought it would be
very simple, but after checking the documentation and the
list I still don't have something that works.
1. as.Date returns the error below. What am I
2005 Apr 06
3
looking for a plot function
Dear useRs,
I have a data frame and I want to plot all rows. Each row is
represented as a line that links the values in each column. The plot
looks like this:
dfr <- data.frame(A=sample(1:50,10),B=sample(1:50,10),
C=sample(1:50,10),D=sample(1:50,10))
xa <- 10*1:4
plot(c(10,40),c(0,50))
for (i in 1:nrow(dfr)) {
lines(xa,dfr[i,],pch=20,type="o")
}
Things get more complicated
2007 Dec 27
1
A function for random test based on longest run (UNCLASSI FIED)
Classification: UNCLASSIFIED
Caveats: NONE
Thanks for your quick response. The program you mentioned below available
from R is based on number of runs (up or down) not based on a longest length
of runs of same events. To be more specific, for example, from a series,
HHTHTTTTHHH, the number of runs are 5, and the longest length of runs of the
same events is 4. I'll check for the website you
2005 Jul 21
3
Rprof fails in combination with RMySQL
Dear R community,
I tried to optimized my R code by using Rprof. In my R code I'm using MySQL
database connections intensively. After a bunch of queries R fails with the
following error message:
Error in .Call("RS_MySQL_newConnection", drvId, con.params, groups, PACKAGE = .MySQLPkgName) :
RS-DBI driver: (could not connect mylogin@mydatabase on dbname "myDB"
2010 Mar 11
3
Define column names to a series of data.frames
Greets to the list!
I am aware that this topic has been discussed several times. And I've
read quite some related posts [1]. Yet, can't seem to give a solution to
my problem.
I have 6 data frames consisting of 6 rows x 7 columns put together from
other data.frames.
Something like:
a b c d e f g
v1 # # # # # # #
v2 # # # # # # #
v3 # # # # # # #
v4 # # # # # # #
v5 # # # # # # #
v6
2005 Mar 18
6
Basic questions about RMySQL
Hello,
Please forget me if I am asking something that is well documented. I have read documentation but there are points that are not clear for me. I am not expert in R nor Databases, but if someone direct me to a tutorial, I will appreciate it..
1. In my understanding, I can install and use RMySQL withouth having to install MySQL in my PC, to have access to and to create new tables . Is this
2005 Feb 10
3
question about sorting POSIXt vector
Dear useRs,
How come the first attempt to sort a POSIXt vector fails (Error:
non-atomic type in greater), while the second succeeds? (Code inserted
below.) The documentation says that POSIXt is used to allow operations
such as subtraction, so I'd expect sorting to work. Is this perhaps an
OS issue? (I run R 2.0.1 on Win xp.)
Thank you,
b.
#------------code
test <- c("2005-02-08
2005 Jun 08
2
get level combinations from "by" list
Dear useRs,
Given this code I end up with a list of class "by":
a <- sample(1:5,200,replace=TRUE)
b <- sample(c("v1","v2","v3"),200,replace=TRUE)
c <- sample(c(11,22,33),200,replace=TRUE)
data <- runif(200)
grouped <- by(data,list(a,b,c),function(x) {c(min=min(x),max=max(x),
median=round(median(x),digits=2),mean=round(mean(x),digits=2))})
2005 Sep 01
4
Linux Standalone Server Suggestions for R
Hi All,
My group is looking for any suggestions on what to purchase to
achieve the most powerful number crunching system that $50k can buy.
The main application that will be used is R so input on what hardware
benefits R most will be appreciated. The requirements are that it be
a single standalone server (i.e. not a cluster solution), and it that
must be able to run unix/linux. If
2005 Mar 11
3
XML to data frame or list
Dear useRs,
I have a simple/RTFM question about XML parsing. Given an XML file,
such as (fragment)
<A>100</A>
<B>23</B>
<C>true</C>
how do I import it in a data frame or list, so that the values (100,
23, true) can be accessed through the names A, B and C?
I installed the XML package and looked over the documentation...
however after 20 minutes and a couple of
2005 Oct 10
1
decreasing performance of for() loop
Dear useRs,
I'm wondering why the for() loop below runs slower as it progresses.
On a Win XP box, the iterations at the beginning run much faster than
those at the end:
1%, iteration 2000, 10:10:16
2%, iteration 4000, 10:10:17
3%, iteration 6000, 10:10:17
98%, iteration 196000, 10:24:04
99%, iteration 198000, 10:24:24
100%, iteration 200000, 10:24:38
Is there something that can be done about
2005 Mar 25
4
Gmail invitation
Hello R users!
I just found out that I have 49 invitations for Gmail (gmail.google.com).
I have been using it now for a while and is really nice. Don't forget
1 GB for free.
I will invite those who respond to this mail by FIFO.
--
Lep pozdrav / With regards,
Gregor Gorjanc
------------------------------------------------------------------------
University of Ljubljana
Biotechnical
2006 Oct 05
1
unexpected behavior of boxplot(x, notch=TRUE, log="y")
A function I've been using for a while returned a surprising [to me,
given the data] error recently:
Error in plot.window(xlim, ylim, log, asp, ...) :
Logarithmic axis must have positive limits
After some digging I realized what was going on:
x <- c(10460.97, 10808.67, 29499.98, 1, 35818.62, 48535.59, 1, 1,
42512.1, 1627.39, 1, 7571.06, 21479.69, 25, 1, 16143.85, 12736.96,
2005 Jun 06
3
Reading huge chunks of data from MySQL into Windows R
Dear List,
I'm trying to use R under Windows on a huge database in MySQL via ODBC
(technical reasons for this...). Now I want to read tables with some
160.000.000 entries into R. I would be lucky if anyone out there has
some good hints what to consider concerning memory management. I'm not
sure about the best methods reading such huge files into R. for the
moment I spilt the whole
2006 Apr 24
2
regression modeling
Hi, there:
I am looking for a regression modeling (like regression trees) approach for
a large-scale industry dataset. Any suggestion on a package from R or from
other sources which has a decent accuracy and scalability? Any
recommendation from experience is highly appreciated.
Thanks,
Weiwei
--
Weiwei Shi, Ph.D
"Did you always know?"
"No, I did not. But I believed..."
2004 Dec 23
3
combination of scatterplot and image graph
Dear R users,
I'm interested in a combination of a scatterplot and an image graph.
I have two large vectors. Because in the scatterplot some areas are
sparsely and others densely populated, I want to see the points, and
I also want their color to be changed based on their density (similar
to a heat map). Is there a function that can do that?
Thank you,
b.
2004 Nov 08
3
misleading output after ordering data frame
Dear R users,
I have a data frame which I create with read.csv and then order by
date:
d <- na.omit(read.csv(...))
d <- d[order(as.Date(as.character(d$Date), format="%d-%b-%y"),
decreasing=F, na.last=F),]
My problem is that even though the data frame is ordered as
requested, the old row numbers are preserved. For example:
* Before sorting:
> d[1:3,]
Date Amt
1
2004 Oct 13
4
incomplete function output
Dear R users,
I have a function (below) which encompasses several tests.
However, when I run it, only the output of the last test is
displayed. How can I ensure that the function root(var)
will run and display the output from all tests, and not
just the last one?
Thank you,
b.
root <- function(var)
{
#---Phillips-Perron
PP.test(var, lshort = TRUE)
PP.test(var, lshort = FALSE)
2005 Feb 25
4
Temporal Analysis of variable x; How to select the outlier threshold in R?
For a financial data set with large variance, I'm trying to find the
outlier threshold of one variable "x" over a two year period. I
qqplot(x2001, x2002) and found a normal distribution. The latter part of
the normal distribution did not look linear though. Is there a suitable
method in R to find the outlier threshold of this variable from 2001 and
2002 in R?