similar to: How to convert character matrix or data.frame to numeric?

Displaying 20 results from an estimated 40000 matches similar to: "How to convert character matrix or data.frame to numeric?"

2015 May 29
2
Why my messages are filtered from the list?
Now I am getting confused. I see two postings from me in the archives: https://stat.ethz.ch/pipermail/r-devel/2015-May/071205.html https://stat.ethz.ch/pipermail/r-devel/2015-April/070982.html Were these actually published to the list? If so - big apology. Regards, Ivan On Fri, May 29, 2015 at 12:43 AM David Winsemius <dwinsemius at comcast.net> wrote: > > On May 28, 2015, at 9:11
2011 Dec 06
1
rugarch package: is this forecast correct?
Let me start with the code: library(quantmod) library(rugarch) getSymbols("SPY", from="1900-01-01") rets=na.trim(diff(log(Cl(SPY)))) tt = tail(rets["/2004-10-29"], 1000) spec = ugarchspec(variance.model=list(garchOrder=c(1,1)), mean.model=list(armaOrder=c(2,5)), distribution.model="sged") for(ii in 1:10) { ttFit = ugarchfit( spec=spec,
2015 May 29
2
Why my messages are filtered from the list?
Hello, Over the last two months I have sent two messages (same topic) to the list. None of them showed on the list. For the first, I got a message that it is in some queue and waiting for an administrator to look at it. Is the queue THAT long?! [[alternative HTML version deleted]]
2009 Dec 13
2
A random number from any distribution?‏
Hello, I have some data, and I want to generate random numbers following the distribution of this data (in other words, to generate a synthetic data set sharing the same stats as a given data set). Reading an old thread I found the following text: >If you can compute the quantile function of the distribution (i.e., the >inverse of the integral of the pdf), then you can use the
2012 Nov 02
1
An idea: Extend mclapply's mc.set.seed with an initial seed value?
Hello, Have been thinking that sometimes users may want each process to initialize its random seed with a specific value rather then the current seed. This could be keyed off depending whether mc.set.seed is logical, preserving the current behaviour, or numerical, using the value in a call to set.seed. Does this make sense? If you wonder how I came up with the idea: I spent a couple of hours
2010 May 17
1
Isn't aggreate.zoo supposed to work with POSIXct (zoo/TTR/xts issue)?
library(xts) library(TTR) ndx = getYahooData("^NDX") aa = ndx$Close bb = aggregate(aa, as.yearweek, tail, 1) The last operation takes forever, and then the bb dates are messed up. The following produces the desired result: time(aa) = as.Date(time(aa)) bb = aggregate(aa, as.yearweek, tail, 1) The index of ndx and aa is of POSIXct (as reported by is(time(ndx))) , which apparently
2011 Feb 10
1
How to determine the quantile boundary from an ECDF?
Given a dataset x, the ecdf is ecdf(x). Then I can use ecdf(x)(y) to find the percentile of y. Given the ecdf is there a way to determine what is the value of y that is the boundary of let's say 95 percentile? In other words, is there a function I can call on the ecdf like: fomeFunc( ecdf( x ), 0.95 ) Which will return the highest value of y, for which ecdf( y ) < 0.95? The only solution
2004 Apr 02
2
"(de)linearizing" array indices
Hi, I have a dynamic programming problem with many state variables, let's call them l, n, m, etc. The transition probabilities are originally given in an array form, eg transtition[l,m,n,ll,mm,nn] give the probability of going from l,m,n to ll,mm,nn. However, the numerical solution is best handled when I "flatten" the L x M x N state space into a single one (call it S), ie a
2015 Dec 11
3
For integer vectors, `as(x, "numeric")` has no effect.
>>>>> Martin Maechler <maechler at stat.math.ethz.ch> >>>>> on Tue, 8 Dec 2015 15:25:21 +0100 writes: >>>>> John Chambers <jmc at r-project.org> >>>>> on Mon, 7 Dec 2015 16:05:59 -0800 writes: >> We do need an explicit method here, I think. >> The issue is that as() uses methods for the generic
2008 Apr 25
2
Differentiate alphanumeric vs numeric strings
I have a bunch of tables in a Microsoft Access database. An updated database is sent to me every week containing a new table. I know that is inefficient and weird but welcome to my life. I want to read the tables whose names are something such as "040207" but not the ones that have alphanumeric names such as "everyone". Using RODBC I am easily able to create a character vector
2003 Sep 03
2
lme in R and Splus
Good Day, Included below is some code to generate data and to fit a mixed effects model to this fake data. The code works as expected when I call the function "lme" in Splus but not in R. The error message from calling lme in R is: "Error in getGroups.data.frame(dataMix, groups) : Invalid formula for groups" I installed the nlme package for R around 20 August
2015 Dec 08
2
For integer vectors, `as(x, "numeric")` has no effect.
We do need an explicit method here, I think. The issue is that as() uses methods for the generic function coerce() but cannot use inheritance in the usual way (if it did, you would be immediately back with no change, since "integer" inherits from "numeric"). Copying in the general method for coercing to "numeric" as an explicit method for "integer" gives
2008 Oct 20
4
aggregating along bins and bin-quantiles
Dear all, I would like to aggregate a data frame (consisting of 2 columns - one for the bins, say factors, and one for the values) along bins and quantiles within the bins. I have tried aggregate(data.frame$values, list(bin = data.frame $bin,Quantile=cut2(data.frame$bin,g=10)),sum) but then the quantiles apply to the population as a whole and not the individual bins. Upon this
2015 Dec 12
2
For integer vectors, `as(x, "numeric")` has no effect.
>>>>> John Chambers <jmc at r-project.org> >>>>> on Fri, 11 Dec 2015 10:11:05 -0800 writes: > Somehow, the most obvious fixes are always back-incompatible these days. > The example intrigued me, so I looked into it a bit (should have been doing something else, but ....) > You're right that this is the proverbial
2009 May 20
2
Too large a data set to be handled by R?
Dear R users, I have been using a dynamic data extraction from raw files strategy at the moment, but it takes a long long time. In order to save time, I am planning to generate a data set of size 1500 x 20000 with each data point a 9-digit decimal number, in order to save my time. I know R is limited to 2^31-1 and that my data set is not going to exceed this limit. But my laptop only has 2 Gb and
2004 Jun 09
1
Using macros
Dear list members, I've been puzzling over how best to clean up the code for my Rcmdr package. In particular, there's a lot of repetitive tcltk code in the package, and as Martin M?chler has pointed out to me, this makes the package difficult to maintain. If R were Lisp, I'd use macros for much of the clean up. My efforts to do similar things with R functions has run into problems
2006 Aug 01
4
Overlay Boxplot with scatter plot
I am trying to make a box plot and overlay it with a scatter plot from another data.frame. I was able to successfully create the boxplot, but when i tried using points(x~y...) the dots did not show up. example code aa<-(300,300,300,300,600,600,600,600,900,900,900,900) bb<-(13,12,14,11,56,44,34,75,22.,34,22,98,59,55,56) cc<-(13,12,14,11,56,44,34,75,22.,34,22,98,59,55,56)
2001 Dec 18
1
Newbie problems with R and compiled C
I'm a beginer programming C and I have the following problem: I have the following C-code file #include <stdlib.h> void gen(int *n, int *a, int *c, int *m, int *x0, int *x); main(){ int nn = 31; int aa = 3; int cc = 0; int mm = 31; int xx0 = 9; int xx[nn]; int i; gen(&nn,&aa,&cc,&mm,&xx0,xx); for (i = 0; i <= nn-1; i++) printf("%d
2010 Jul 18
5
package "plotrix"
I installed package plotrix because reading its vignette it looks like it can help me solve a "legend" problem. The package instaleed correctly on my Mac OS/X 10.5.8 But I cannot reproduce the examples centered on function "lgendg". > library(plotrix) > plot(0.5,0.5,xlim=c(0,1),ylim=c(0,1),type="n", + main="Test of grouped legend function") >
2013 Jun 26
3
XYZ data
I have x, y, z data. The x, y fields dont change but Z does. How do I add a very small number onto the end of each x, y data point. For example: Original (X) Original (Y) Original (Z) 15 20 30 15 20 40 New (X) New (Y)