similar to: turning list-elements into a vector

Displaying 20 results from an estimated 10000 matches similar to: "turning list-elements into a vector"

2003 Sep 12
7
convert a Character-string to a number
Hi Everyone. I have a simple problem but don't know, how to get along. how can I convert the vector a<-c("0,01","1,00") in a vector b<-c(0.01,1.00) Thank you for suggestions M.Kirschbaum [[alternative HTML version deleted]]
2003 Jul 31
6
how to make a plot without any axis-labeling
Hi. I got a problem, perhaps someone can help me....... every time, when I want to plot data, both axis are labeled by default like data[1,] and data[2,] how can I make a plot without ANY labeling? does anyone know that? thanks for helping Michael [[alternative HTML version deleted]]
2003 Sep 16
7
Retrieve ... argument values
Dear R users, I want to retrieve "..." argument values within a function. Here is a small exmaple: myfunc <- function(x, ...) { if (hasArg(ylim)) a <- ylim plot(x, ...) } x <- rnorm(100) myfunc(x, ylim=c(-0.5, 0.5)) Error in myfunc(x, ylim = c(-0.5, 0.5)) : Object "ylim" not found > I need to retrieve values of "ylim" (if it is defined
2005 Apr 20
2
Package under R 2.1.0: package.rds
Hi everybody, I have trouble installing my own package under R 2.1.0 (it is fine under R 2.0.1). My OS is Windows NT. I installed my package 'mag' by using menu "Packages/Install package from local zip files....". It's fine (html package description was updated). But when I typed in library(mag) it gave me error: Error in library(mag) : there is no package called
2003 Sep 12
2
Sorting a vector by date
Hello out there.... Again I have a problem and I stuck... How can I sort a vector of dates? For example I have the vector a<-ISOdate(2001, 1, 1) + 70*86400*runif(10) How can this vector be sorted chronological? And what's the function I should work with to handle these entries? (in sense of: which(a>2001-01-04) or somehting like that) Thank you for helping M.Kirschbaum
2013 Feb 06
3
how to "multiply" list of matrices by list of vectors
Hi everyone, I'd like to be able to apply lda to each 2D matrix slice of a 3D array, and then use the scalings to obtain the corresponding lda scores. I can use 'apply' to get a list of the lda output for each 2D slice, and can create a list of the resulting scalings, but I'm not sure how to multiply them in a vectorized way. Here's how I made a list of 2D matrices
2005 Apr 21
1
Installing packages from source code
Hi everybody, I have trouble in installing packages from source code by following Section 5.1 in manual R-admin.pdf . I am using R 2.1.0 and Win NT. Following the Windows toolset section in the manual, I download the tool set package from: http://www.murdoch-sutherland.com/Rtools/tools.zip and unzip under C:\tools I also downloaded Perl (Windows Port) and installed it.
2008 Jun 23
2
Writing Vector to a File
Dear experts, I try not to trouble the list again after this question. I want to print this vector into a file > myvec [1] --Control --Control --Control --Control --Control HBA2 HBA1 [8] HBA1 --Control HBB --Control HBB HBA1 MBP [15] --Control HBA1 HBA2 HBB PTGDS GAPDH UBC [22] --Control GAPDH TPT1 HUWE1 PRM1 CKM
2011 Dec 21
2
unique combinations
Hi there, I have a vector and would like to create a data frame, which contains all unique combination of two elements, regardless of order. myVec <- c(1,2,3) what expand.grid does: 1,1 1,2 1,3 2,1 2,2 2,3 3,1 3,2 3,3 what I would like to have 1,1 1,2 1,3 2,2 2,3 3,3 Can anybody help?
2011 Jun 04
3
cbind 3 or more matrices
How can I cbind three or more matrices like A,B and C. This does not work: cbind(A,B,C) -- Thanks, Jim. [[alternative HTML version deleted]]
2007 Sep 21
3
Q: appending to non-existent vector?
This is a real newbie question. What makes it worse is that I know I've seen the answer somewhere, but I can no longer find it. If I have a loop that is supposed to generate a vector piecemeal, adding an element each time through the loop, what do I do to stop it failing the first time around the loop, when the vector doesn't yet exist (so I can't use the append() function)?
2003 Aug 06
1
Standard error of standard deviation: bootstrap or theoretical results?
Dear R users, This is more a statistical question rather than an R question. I'd appreciate it if you can give me some suggestions. I have a sample of a time series (sample size 500, fat tail in density). I am trying to calculate the Standard error of standard deviation of a sub-block-sample (sample size 250). I take 100 this kind of sub-block-sample, randomly. For these 100 subsamples, I
2007 Sep 16
1
programming question
Dear list, I have a vector of numbers, let's say: myvec <- c(2, 8, 24, 26, 51, 57, 58, 78, 219) My task is to reduce this vector to non-reducible numbers; small numbers can cross-out some of the larger ones, based on a function let's say called reduce() If I apply the function to the first element 2, my vector gets shorted to: > (myvec <- reduce(myvec[1])) [1] 2 24 51
2011 Aug 24
3
Efficient way to Calculate the squared distances for a set of vectors to a fixed vector
I am pretty new to R. So this may be an easy question for most of you. ? I would like to calculate the squared distances of a large set (let's say 20000) of vectors (let's say dimension of 5) to a fixed vector. ? Say I have a data frame MY_VECTORS with 20000 rows and 5 columns, and one 5x1 vector y. I would like to efficiently calculate the squared distances?between each of the 20000
2005 Sep 01
1
More block diagonal matrix construction code
Folks: In answer to a query, Andy Liaw recently submitted some code to construct a block diagonal matrix. For what seemed a fairly straightforward task, the code seemed a little "overweight" to me (that's an American stock analyst's term, btw), so I came up with a slightly cleaner version (with help from Andy): bdiag<-function(...){ mlist<-list(...) ## handle case in
2011 Nov 26
2
simplify source code
Hi I would like to shorten mod1 <- nls(ColName2 ~ ColName1, data = table, ...) mod2 <- nls(ColName3 ~ ColName1, data = table, ...) mod3 <- nls(ColName4 ~ ColName1, data = table, ...) ... is there something like cols = c(ColName2,ColName3,ColName4,...) for i in ... mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...) I am looking forward to help Christof
2010 Mar 10
1
How can I sort a character type vector?
Dear All, I want to sort a character type vector. the vector is [1] 4 5 6 8 9 11 Y 1 13 15 16 20 X 2 3 10 14 19 XY 7 12 18 17 22 [25] 21 and I want to sort 1-22 X Y XY or 1-22 X XY Y. How can I do that? Thanks,
2015 May 04
2
[LLVMdev] Incorrect code generated for arm64
Hi all, I’ve narrowed down a problem in my code to the following test case: - - - - typedef struct {float v[2];} vec2; typedef struct {float v[3];} vec3; vec2 getVec2(); vec3 getVec3() { vec2 myVec = getVec2(); vec3 res; res.v[0] = myVec.v[0]; res.v[1] = myVec.v[1]; res.v[2] = 1; return res; } - - - - Compiling this with any level of optimization for arm64 gives incorrect code,
2003 Feb 20
3
outliers/interval data extraction
Dear R-users, I have two outliers related questions. I. I have a vector consisting of 69 values. mean = 0.00086 SD = 0.02152 The shape of EDA graphics (boxplots, density plots) is heavily distorted due to outliers. How to define the interval for outliers exception? Is <2SD - mean + 2SD> interval a correct approach? Or should I define 95% (or 99%) limit of agreement for data interval,
2007 Jan 30
6
jump in sequence
Dear list, This should be a simple one, I just cannot see it. I need to generate a sequence of the form: 4 5 6 13 14 15 22 23 24 That is: starting with 4, make a 3 numbers sequence, jump 6, then another 3 and so on. I can create a whole vector with: myvec <- rep(rep(c(F, T, F), rep(3, 3)), 3) Then see which are TRUE: which(myvec) [1] 4 5 6 13 14 15 22 23 24 I'd like to avoid