similar to: how to convert a string vector to a numeric vector

Displaying 20 results from an estimated 6000 matches similar to: "how to convert a string vector to a numeric vector"

2007 May 20
1
lattice contourplot error
Hello, A weird thing is happening to me. I have a 128x128 elements matrix m with values between 0 and 1. If I do: R> library(lattice) R> contourplot (m, cuts=9) I get the following error message: Error in validDetails.text(x) : Invalid 'rot' value The same for any cuts >9. I can plot m with contourplot(m, cuts=8) but this is not detailed enough. The 'normal'
2007 Jan 14
4
Controlling size of boxplot when it is added in a plot
Greetings, I am trying to add a boxplot to the bottom of a histogram, right between the histogram bars and the x axis. Here is the code I am using at the moment (the par line is probably not relevant for our discussion): hs <- hist(x, breaks = 20, plot = F) par(mar = c(3,3,2,1)) hist(x, breaks = 20, main = NULL, ylim = c(-2, max(hs$counts))) boxplot(x, horizontal = T, axes = T, add =
2012 Aug 07
2
Error using ddply inside user-defined function
Hi All, I *think* it's ddply because the function recognizes vr1, etc, in other parts of the function. Here's some code: # create dataset PROV.PM.FBCTS <- c(0.00 ,0.00, 33205.19, 25994.56, 23351.37, 26959.56 ,27632.58, 26076.24, 0.00, 0.00 , 6741.42, 18665.09 ,18129.59 ,21468.39 ,21294.60 ,22764.82, 26076.73) FBCTS.INV.TOT <- c(0 , 0, 958612, 487990, 413344, 573347,
2007 Mar 01
2
R code for "Statistical Models in S" ?
I just acquired a copy of "Statistical Models in S", I guess most commonly known as the "white book", and realized to my dismay that most of the code is not directly executable in R, and I was wondering if there was a source discussing the things that are different and what the new ways of calling things are. For instance, the first obstacle was the solder.balance data
2007 Feb 04
4
Reading expressions from character vectors
Greetings, I have a problem that I am sure is very straightforward, but I just can't wrap my head around it. I've read the help pages on text, plotmath, expression, substitute, but somehow I can't find the answer to this simple question. Basically consider the following example: plot( NULL, xlim = c(0,2), ylim = c(0,2) ) expressions <- expression( -infinity, infinity )
2007 Feb 22
1
Cross-tabulations next to each other
I have the following relatively simple problem. Say we have three factors, and we want to create a cross-tabulation against each of the other two: x <- factor(rbinom(5, 1, 1/2)) y <- factor(rbinom(5, 1, 1/2)) z <- factor(rbinom(5, 1, 1/2)) table(x,y) table(x,z) This looks like: y x 0 1 0 2 0 1 1 2 z x 0 1 0 1 1 1 2 1 I would like to get (surely this will
2008 Mar 05
4
vertex labels in igraph from adjacency matrix
I am getting some unexpected results from some functions of igraph and it is possible that I am misinterpreting the vertex numbers. Eg., the max betweenness measure seems to be from a vertex that is not connected to a single other vertex. Below if my code snippet: require(igraph) my.graph <- graph.adjacency(adjmatrix = my.adj.matrix, mode=c("undirected")) most.between.vert <-
2010 Aug 06
3
yum-fastestmirror inconsistent exclude behavior
Hi guys, I'm trying to figure out something wherein excluded repositories for the yum-fastestmirror plugin are still being used by the system. To illustrate: [root at sales ~]# cat /etc/yum/pluginconf.d/fastestmirror.conf [main] enabled=1 verbose=0 socket_timeout=3 hostfilepath=/var/cache/yum/timedhosts.txt maxhostfileage=10 maxthreads=15 #exclude=.gov, facebook exclude=maulvi, .gov.ph, .vn
2016 Sep 01
2
[RFC] Interprocedural MIR-level outlining pass
Hi Daniel, Consider me convinced (not sure you care, but still... :-)) What confused me is that this is not VN in a traditional sense -- it's more like using VN's infrastructure to compute something different. But one can use VN's code for this, indeed. Thank you for the explanation! Yours, Andrey On Thu, Sep 1, 2016 at 4:24 AM, Daniel Berlin <dberlin at dberlin.org> wrote:
2012 Dec 13
3
how to aggregate the dataset
HI, Sorry for messing up.. I want to transform the following dataset: product min_price max_price mean_price country price_band 11 34 50 40 VN 0-300 22 10 30 15 VN 0-300 Into: product VN price_band 11 40 0-300 [34,50] 22 15
2008 Mar 10
3
Weighting data when running regressions
Dear R-Help, I'm new to R and struggling with weighting data when I run regression. I've tried to use search to solve my problem but haven't found anything helpful so far. I (successfully) import data from SPSS (15) and try to run a linear regression on a subset of my data file where WEIGHT is the name of my weighting variable (numeric), e.g.: library(foreign)
2007 Dec 17
3
Cannot grasp how to apply "by" here...
I have a data frame named "database" with panel data, a little piece of which looks like this: Symbol Name Trial Factor1 Factor2 External 1 548140 A 1 -3.87 -0.32 0.01 2 547400 B 1 12.11 -0.68 0.40 3 547173 C 1
2011 Aug 10
2
Opposite of paste function
Dear All, I have vn variable > vn [1] "V300" "V376" What I want to get is 300 376 without V and "" from vn variable. Could you help me about this issue? Thank you, Soyeon [[alternative HTML version deleted]]
2013 Mar 02
1
Expressions in lattice conditional variables
I would like to have a lattice conditioning ( | var ) variable have expression() as values because I want panel labels to be able to use plotmath notation for subscripts, etc. lattice barks at this. Does anyone know of a trick workaround? An attempted example program is below. Thanks -Frank require(lattice) set.seed(1) var <- c(rep('A', 100), rep('B', 100)) trt <-
2006 Mar 17
0
[LLVMdev] Stupid '-load-vn -licm' question (LLVM 1.6)
On Thu, 16 Mar 2006, Eric Kidd wrote: > Hello! I'm compiling code which uses pointers as iterators. For some > reason--probably a silly misunderstanding of the docs--I can't eliminate > duplicate pointer loads. I'll probably figure this out eventually, but if > somebody else sees the answer instantly, I certainly won't complain. :-) There are no stupid questions.
2007 Nov 07
3
Indexing, and using an empty string as a name
Hello all, I ran into the following, to me unexpected, behavior. I have (for reasons that don't necessarily pertain to the question at hand, hence I won't go into them) the need/desire to use an empty string for the name of a vector entry. Perhaps I did not read ?"[" very carefully, but it seems to me that he following lines should return "1" at the end:
2008 May 23
2
About Passing Arguments to Function
Hi, Below I have a function mlogl_k, later it's called with "nlm" . __BEGIN__ vsamples<- c(14.7, 18.8, 14, 15.9, 9.7, 12.8) mlogl_k <- function( k_func, x_func, theta_func, samp) { tot_mll <- 0 for (comp in 1:k_func) { curr_mll <- (- sum(dgamma(samp, shape = x_func, scale=theta_func, log = TRUE))) tot_mll <- tot_mll + curr_mll }
2016 Aug 31
2
[RFC] Interprocedural MIR-level outlining pass
> > > Yes, this was exactly my point. We want to recognize > structurally-equivalent sequences of instructions on inequivalent operands. > Yes, and my point is "none of the vn and vn-dag generating algorithms care". you can define equivalent to be "structural", you can define it to be "these two variables are equivalent if they both start with
2006 Nov 08
6
Making a case for using R in Academia
Hello, new to the list, first message. This question perhaps might be more appropriate to R-sig-teaching, and I'd be happy to take it there if this is not the right place for it. I am teaching applied statistics at a small liberal arts college with limited resources, and we are currently using SPSS for our courses. Mainly the reason for this, as I understand it, is that this is what
2008 Jun 07
2
Using lm with a matrix?
I'm trying to do a linear regression between the columns of matrices. In example below I want to regress column 1 of matrix xdat with column1 of ydat and do a separate regression between the column 2s of each matrix. But the output I get seems to give correct slopes but incorrect intercepts and another set of slopes with value NA. How do I do this correctly? I'm after the slope and