[R] vector values substitution in an expression using label_bquote in ggplot()

2021-03-02 Thread Shaami
Dear Sir I am using label_bquote() for labeling facet plots in ggplot(). I need to write the expression a_[12], a_[13] etc for each plot. I am writing as ggplot() + facet_grid(..., labeller=label_bquote(rows = a[1, 2:3]) The above exemplary code writes only a_[12] for each facet plot. Could

Re: [R] Vector memory exhausted (limit reached?)

2019-10-28 Thread David Winsemius
On 10/28/19 2:17 PM, varin sacha via R-help wrote: Dear R-experts, My reproducible example here below is not working because of an error message : Erreur : vecteurs de mémoire épuisés (limite atteinte ?) My code perfectly works when n=3000 or n=5000 but as soon as n=1 my code does not

[R] Vector memory exhausted (limit reached?)

2019-10-28 Thread varin sacha via R-help
Dear R-experts, My reproducible example here below is not working because of an error message : Erreur : vecteurs de mémoire épuisés (limite atteinte ?) My code perfectly works when n=3000 or n=5000 but as soon as n=1 my code does not work anymore. By the way, my code takes a very long time

Re: [R] Vector of symbols?

2015-10-31 Thread Boris Steipe
You are describing an awkward way of doing this (and your example is unreadable because you are not following posting instructions for the list) ... but the following contains the essence of what I think is needed: parse() and eval(). v <- character() v[1] <- sprintf("%d ^ %s", 2, "duck") v[2]

Re: [R] Vector of symbols?

2015-10-31 Thread Jeff Newmiller
I believe it is possible, but R is not really a full-fledged symbolic algebra system so it wouldn't be an intuitive tool to use and what would you do with it once you had it? It is much more useful in R to do something like f1 <- function( M, A, B, C ) { M %*% c( A, B, C ) } m <- matrix(

[R] Vector of symbols?

2015-10-31 Thread Judson
Is there a way to multiply a matrix times a vector of symbols? For instance, could I do this: 1 0 0 a 01 0 times b -1 2 1 c which should result in :

Re: [R] vector of constant values

2015-10-29 Thread Bert Gunter
Have you read any R tutorials?? This is about as basic as it gets. ?rep -- Bert P.S. Due to vectorized operations, there is probably no need to do this anyway! Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On

Re: [R] vector of constant values

2015-10-29 Thread Sarah Goslee
If you mean you need a matrix of that size, matrix(1, nrow=200, ncol=2) On Thu, Oct 29, 2015 at 1:07 PM, thanoon younis wrote: > Dear Members, > > I want to simulate a vector of constants values with dimention = 200x2 and > all values of this vector are 1. > > Any

Re: [R] vector of constant values

2015-10-29 Thread Gerrit Eichner
Hi, Thanoon! I want to simulate a vector of constants values with dimention = 200x2 and all values of this vector are 1. You mean "I want to _construct_ a _matrix_ of dimension 200 x 2 with all entries equal to 1", don't you? Homework? Take a look at ?matrix Hth -- Gerrit Any help

[R] vector of constant values

2015-10-29 Thread thanoon younis
Dear Members, I want to simulate a vector of constants values with dimention = 200x2 and all values of this vector are 1. Any help please. Regards -- Thanoon Y. Thanoon PhD Candidate Department of Mathematical Sciences Faculty of Science University Technology Malaysia, UTM E.Mail:

Re: [R] vector graphics

2015-10-07 Thread Ivan Calandra
Thanks Jean for the tip. I'll try postscript() and devEMF::emf() and see if it works. Still, it's very complicated to export vector graphics in R... Ivan -- Ivan Calandra, PhD University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland Garros 51100 Reims, France +33(0)3 26

Re: [R] vector graphics

2015-10-07 Thread Ivan Calandra
For the record, it seems that devEMF::emf() works fine on the Windows Vista SP2 machine with R3.2.2 and Illustrator CS4: the text is recognized as text and every point/line can be dissociated. Ivan -- Ivan Calandra, PhD University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2

Re: [R] vector graphics

2015-10-06 Thread Adams, Jean
Perhaps the discussion at this link will be helpful ... http://stackoverflow.com/questions/9555889/producing-a-vector-graphics-image-i-e-metafile-in-r-suitable-for-printing-in Jean On Tue, Oct 6, 2015 at 9:42 AM, Ivan Calandra wrote: > Dear useRs, > > A colleague

[R] vector graphics

2015-10-06 Thread Ivan Calandra
Dear useRs, A colleague of mine is having a problem with graphic devices. The goal is to save into a vector graphic format that can be edited with Illustrator CS4. On my Mac (Snow Leopard), I use RSvgDevice::devSVG() and it works fine. But on her Windows Vista computer, I cannot find an

Re: [R] vector manipulations -- differences

2015-09-22 Thread Frank Schwidom
And if we want to use the approach of William Dunlap for sequence.optimization , then we can write: rev( xr[ seq_len(sum(vec)) - rep.int(cumsum(c(0L, vec[-length(vec)])), vec)] - rep.int( xr[ -1], vec)) Regards. On 2015-09-22 23:43:10, Frank Schwidom wrote: > Hi, > > xr <- rev( x) > vec <-

Re: [R] vector manipulations -- differences

2015-09-22 Thread Frank Schwidom
Hi, xr <- rev( x) vec <- 1:(length( x) - 1) rev( xr[ sequence( vec)] - rep.int( xr[ -1], vec)) On 2015-09-21 14:17:40, Dan D wrote: > I need an efficient way to build a new n x (n-1)/2 vector from an n-vector x > as: > > c(x[-1]-x[1], x[-(1:2)]-x[2], ... , x[-(1:(n-1)] - x[n-1]) > > x is

Re: [R] vector manipulations -- differences

2015-09-21 Thread Bert Gunter
Use ?mappy and ?rep.int > x[unlist(mapply(":",2:4,4))] - x[rep.int(1:3,3:1)] [1] 3 7 20 4 17 13 Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Mon, Sep 21, 2015 at 2:17 PM, Dan D

[R] vector manipulations -- differences

2015-09-21 Thread Dan D
I need an efficient way to build a new n x (n-1)/2 vector from an n-vector x as: c(x[-1]-x[1], x[-(1:2)]-x[2], ... , x[-(1:(n-1)] - x[n-1]) x is increasing with x[1] = 0. The following works but is not the greatest: junk<-outer(x, x, '-') junk[junk>0] e.g., given x<-c(0, 3, 7, 20)

Re: [R] Vector of Numbers Not Output to Screen

2014-07-20 Thread Dario Strbenac
It's a plausible use-case. For example, in the example section of a help file. if(require(aPackage)) { # Do computations. # Show beginning of first result vector. # Show beginning of second result vector. } __ R-help@r-project.org mailing list

Re: [R] Vector of Numbers Not Output to Screen

2014-07-20 Thread Duncan Murdoch
On 17/07/2014, 10:00 PM, Dario Strbenac wrote: The example in the question was not inside a user function. The explanations you were given were slightly inaccurate. The usual rule is that results returned at the top level are printed unless they are marked as invisible. (There are a few cases

Re: [R] Vector of Numbers Not Output to Screen

2014-07-20 Thread David Winsemius
On Jul 20, 2014, at 6:30 AM, Duncan Murdoch wrote: On 17/07/2014, 10:00 PM, Dario Strbenac wrote: The example in the question was not inside a user function. The explanations you were given were slightly inaccurate. The usual rule is that results returned at the top level are printed

Re: [R] Vector of Numbers Not Output to Screen

2014-07-20 Thread Duncan Murdoch
On 20/07/2014, 5:46 PM, David Winsemius wrote: On Jul 20, 2014, at 6:30 AM, Duncan Murdoch wrote: On 17/07/2014, 10:00 PM, Dario Strbenac wrote: The example in the question was not inside a user function. The explanations you were given were slightly inaccurate. The usual rule is that

Re: [R] Vector of Numbers Not Output to Screen

2014-07-18 Thread Rolf Turner
On 18/07/14 15:00, Dario Strbenac wrote: The example in the question was not inside a user function. Don't be silly. cheers, Rolf Turner -- Rolf Turner Technical Editor ANZJS __ R-help@r-project.org mailing list

[R] Vector of Numbers Not Output to Screen

2014-07-17 Thread Dario Strbenac
Hello, I have a block of code that has two head calls at the end, but only the second is shown on screen. If I manually execute the statement which is not showing, it works. I thought that if statements are not functions. It is behaving as one. if(1 2) + { + x-rnorm(100) + y - rpois(10,

Re: [R] Vector of Numbers Not Output to Screen

2014-07-17 Thread Sarah Goslee
Hi, You can get the behaviour you want using the print() command: if(1 2) { x-rnorm(100) y - rpois(10, 5) print(head(x)) print(head(y)) } Sarah On Thu, Jul 17, 2014 at 2:00 AM, Dario Strbenac dstr7...@uni.sydney.edu.au wrote: Hello, I have a block of code that has two head calls

Re: [R] Vector of Numbers Not Output to Screen

2014-07-17 Thread Rui Barradas
Hello, Also, unlike what the op says, if statements are functions, explaining the behavior he got. Hope this helps, Rui Barradas Em 17-07-2014 16:53, Sarah Goslee escreveu: Hi, You can get the behaviour you want using the print() command: if(1 2) { x-rnorm(100) y - rpois(10, 5)

Re: [R] Vector of Numbers Not Output to Screen

2014-07-17 Thread Jeff Newmiller
This question is related to FAQ 7.16, which you should look up. In general, whenever you just type a variable or function directly at the command line, R prints the result for you. Inside code blocks of any kind, it does not do that, so you need to use the print function yourself. On Thu, 17

Re: [R] Vector of Numbers Not Output to Screen

2014-07-17 Thread David Winsemius
On Jul 17, 2014, at 9:27 AM, Rui Barradas wrote: Hello, Also, unlike what the op says, if statements are functions, explaining the behavior he got. I'm not sure that is correct. The help page says if() is a control-construct. I think the function is actually { {rnorm(10); rpois(10, 3)}

Re: [R] Vector of Numbers Not Output to Screen

2014-07-17 Thread Rolf Turner
On 18/07/14 11:32, David Winsemius wrote: On Jul 17, 2014, at 9:27 AM, Rui Barradas wrote: Hello, Also, unlike what the op says, if statements are functions, explaining the behavior he got. I'm not sure that is correct. The help page says if() is a control-construct. I think the function

Re: [R] Vector of Numbers Not Output to Screen

2014-07-17 Thread Bert Gunter
Rolf et.al I have not followed this thread closely and so have nothing to say about whose or what explanation is correct. However, the following statement is misleading, if not wrong: --- foo - function(){ x - 17 x y - 42 y } If you type foo() you get [1] 42 which is

Re: [R] Vector of Numbers Not Output to Screen

2014-07-17 Thread Dario Strbenac
The example in the question was not inside a user function. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

[R] vector density plot

2014-03-29 Thread Jinsong Zhao
Hi there, Is there a function in R that can draw vector density plot? The vector density plot example can be found here: http://reference.wolfram.com/mathematica/ref/VectorDensityPlot.html As for the vector field plot, I found a function that has been posted in this mailing list:

Re: [R] vector where elements are functions evaluated at integers, but length of vector varies

2013-10-10 Thread Carl Witthoft
Hi, I have two integers a and b (with ab), as well as a function f(x). Is there a way of getting the vector (f(a), ..., f(b)) from R without having to explicitly write it out? as my a and b vary. Thanks for your help lt;/quote What did you try?Further, without knowing what your function

Re: [R] Vector from csv file.

2013-10-02 Thread arun
Hi, It is not clear whether you read the file correctly or not.  Please check str(tbl_all) The code you showed should work if the file was read correctly. For example: set.seed(468) tbl_all-

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-24 Thread Philippe Grosjean
Hi JCFaria, You package is supposed to be used only under Windows, right? Then, use: OS_type=windows in the DESCRIPTION file… and, of course, use R CMD check/R CMD build/ R CMD INSTALL under Windows only. Best, Philippe On 23 Sep 2013, at 20:55, Jose Claudio Faria joseclaudio.fa...@gmail.com

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-24 Thread Prof Brian Ripley
On 24/09/2013 03:51, Jose Claudio Faria wrote: I think I found the main problem! I am developing the package under Linux and after R CMD build, manually compressing the folder TinnRcom inside of the folder TinnRcom.RCheck and installing in Windows. And how on earth did you expect the helpers

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-24 Thread Jose Claudio Faria
Hi, I prefer to build my packages on Linux! I changed the object trPaths as below, After R CMD build TinnRcom on Linux and did the installation on Windows from the source code: It worked very well! I thank all who contributed to the solution and apologize for my lack of knowledge in this area.

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Gabor Grothendieck
On Mon, Sep 23, 2013 at 2:55 PM, Jose Claudio Faria joseclaudio.fa...@gmail.com wrote: trPaths - paste(paste(Sys.getenv('APPDATA'), '\\Tinn-R\\tmp\\', sep=''), c('', 'search.txt',

[R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Jose Claudio Faria
I have been developing a new package (TinnRcom) to avoid the necessity of any script (as below) in the Rprofile.site file related to the use of Tinn-R Editor and R: #=== # Tinn-R: necessary packages and functions # Tinn-R: = 2.4.1.1 with

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Jose Claudio Faria
I appreciate your attention Gabor. However, the result was the same. :( Both only work when the trPath object is sent to a R session already running. When inside the package the result was the same. remove.packages('TinnRcom') Install.packages('TinnRcom_1.0-09.zip', repos=NULL) # New version

Re: [R] Vector of char generated by Sys.getenv function is not available when the package is loaded

2013-09-23 Thread Jose Claudio Faria
I think I found the main problem! I am developing the package under Linux and after R CMD build, manually compressing the folder TinnRcom inside of the folder TinnRcom.RCheck and installing in Windows. As the APPDATA environment variable does not exist in Linux, the function Sys.getenv (APPDATA)

[R] vector question

2013-06-17 Thread Andras Farkas
Dear All, would you please help with the following: let us say I have: a -c(0,1,12,13,24,25,36,37) b -c(6,24.6,27) #then I extract every 2nd element from a d -a[seq(1, length(a), 2)] and what I need help with is to extract the 1st value from d that is greater than the values in b, so as a

Re: [R] vector question

2013-06-17 Thread arun
May be this helps: d[cumsum(sapply(d,function(x) any(xb)))=1] #[1] 12 24 36 A.K. - Original Message - From: Andras Farkas motyoc...@yahoo.com To: r-help@r-project.org Cc: Sent: Monday, June 17, 2013 2:29 PM Subject: [R] vector question Dear All, would you please help

Re: [R] vector question

2013-06-17 Thread arun
HI Andras, Sorry, I misunderstood your question: Try this:  sapply(sapply(b,function(x) d[xd]),`[`,1) #[1] 12 36 36 - Original Message - From: Andras Farkas motyoc...@yahoo.com To: arun smartpink...@yahoo.com Cc: Sent: Monday, June 17, 2013 2:48 PM Subject: Re: [R] vector question

Re: [R] vector question

2013-06-17 Thread William Dunlap
...@r-project.org] On Behalf Of arun Sent: Monday, June 17, 2013 11:58 AM To: Andras Farkas Cc: R help Subject: Re: [R] vector question HI Andras, Sorry, I misunderstood your question: Try this:  sapply(sapply(b,function(x) d[xd]),`[`,1) #[1] 12 36 36 - Original Message

[R] R vector

2013-06-11 Thread felice
.n4.nabble.com/R-vector-tp4669233.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] R vector

2013-06-11 Thread Rui Barradas
the matrix 1 1 -1 -1 - rowMeans([1:3 , 2]) just positive - 1 1 -1 -1 -2 1/2 here not 0 because we dont use the -1 1 1 1 1 1 thanks for helping -- View this message in context: http://r.789695.n4.nabble.com/R-vector-tp4669233.html Sent from the R help mailing list archive

Re: [R] R vector

2013-06-11 Thread Adams, Jean
]) just positive - 1 1 -1 -1 -2 1/2 here not 0 because we dont use the -1 1 1 1 1 1 thanks for helping -- View this message in context: http://r.789695.n4.nabble.com/R-vector-tp4669233.html Sent from the R help mailing list archive at Nabble.com

Re: [R] R vector

2013-06-11 Thread arun
HI, Not sure if this is what you wanted. mat1- matrix(c(1, 1, -1, -1, 1, -1, -1, -2, 1, 1, 1, 1), byrow=TRUE, nc=4) fun1- function(mat){     matP- mat     matN- mat     matP[matP0]- NA     matN[matN0]- NA     resP-rowSums(matP,na.rm=TRUE)/ncol(matP)     resN-

Re: [R] Vector allocation problem while trying to plot 6 MB data file

2013-05-08 Thread Ramon Hofer
Thanks for your answer Uwe On Fri, 03 May 2013 23:36:24 +0200 Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 02.05.2013 14:37, Ramon Hofer wrote: I'm trying to analyse the network speed and used iperf to create a csv file containing the link test data. It's only about 6 MB big but

Re: [R] Vector allocation problem while trying to plot 6 MB data file

2013-05-08 Thread Uwe Ligges
On 08.05.2013 13:38, Ramon Hofer wrote: Thanks for your answer Uwe On Fri, 03 May 2013 23:36:24 +0200 Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 02.05.2013 14:37, Ramon Hofer wrote: I'm trying to analyse the network speed and used iperf to create a csv file containing the link

Re: [R] Vector allocation problem while trying to plot 6 MB data file

2013-05-03 Thread Uwe Ligges
On 02.05.2013 14:37, Ramon Hofer wrote: Hi all I'm trying to analyse the network speed and used iperf to create a csv file containing the link test data. It's only about 6 MB big but contains about 40'000 samples. I can do boxplots (apart from printing the number of samples but I ask

[R] Vector allocation problem while trying to plot 6 MB data file

2013-05-02 Thread Ramon Hofer
Hi all I'm trying to analyse the network speed and used iperf to create a csv file containing the link test data. It's only about 6 MB big but contains about 40'000 samples. I can do boxplots (apart from printing the number of samples but I ask separately for that). To find the behaviour over

[R] Vector with zeros and ones

2013-04-22 Thread Ayyappa
Dear group, I want to generate a vector of 10 elements that always has 20% zeroes, but with a random ordering of zeroes and ones. Can you please suggest a function to do that in R? I tried 'sample' function but the 20% zeros was not always guaranteed. Thanks for your help. Regards, Ayyappa

Re: [R] Vector with zeros and ones

2013-04-22 Thread R. Michael Weylandt
On Mon, Apr 22, 2013 at 7:21 PM, Ayyappa ayyapp...@gmail.com wrote: Dear group, I want to generate a vector of 10 elements that always has 20% zeroes, but with a random ordering of zeroes and ones. Can you please suggest a function to do that in R? I tried 'sample' function but the 20%

Re: [R] Vector with zeros and ones

2013-04-22 Thread Marc Schwartz
On Apr 22, 2013, at 6:21 PM, Ayyappa ayyapp...@gmail.com wrote: Dear group, I want to generate a vector of 10 elements that always has 20% zeroes, but with a random ordering of zeroes and ones. Can you please suggest a function to do that in R? I tried 'sample' function but the 20% zeros

Re: [R] Vector with zeros and ones

2013-04-22 Thread Marc Schwartz
On Apr 22, 2013, at 6:28 PM, Marc Schwartz marc_schwa...@me.com wrote: On Apr 22, 2013, at 6:21 PM, Ayyappa ayyapp...@gmail.com wrote: Dear group, I want to generate a vector of 10 elements that always has 20% zeroes, but with a random ordering of zeroes and ones. Can you please suggest

[R] vector field from a 3D scalar field

2013-03-21 Thread Waichler, Scott R
I have a 3D field of a scalar variable (x, y, z, value). Is there a way to generate a vector field from this data--gradient at defined points? I found the rasterVis package for 2D data, but as yet nothing for 3D data. Thanks, Scott Waichler Pacific Northwest National Laboratory Richland, WA

Re: [R] vector field from a 3D scalar field

2013-03-21 Thread David Winsemius
On Mar 21, 2013, at 4:40 PM, Waichler, Scott R wrote: I have a 3D field of a scalar variable (x, y, z, value). Is there a way to generate a vector field from this data--gradient at defined points? I found the rasterVis package for 2D data, but as yet nothing for 3D data. Can't you just

[R] vector indexing

2012-10-23 Thread Al Ehan
Hi, I got a small problem on how to define the vector index without manually inspect the vector. example: y=c(2,3,5,2,4,6,8,3,6,2,5) #I have ten set of this kind of vectors (with different values but same length) that I would also like to run the routine below #say; v=the first index in y

Re: [R] vector indexing

2012-10-23 Thread Ivan Calandra
Hi, Is it what you're looking for? which(y4) ##all indexes for y4 [1] 3 6 7 9 11 which(y4)[1] ##the first index [1] 3 HTH, Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06

Re: [R] vector indexing

2012-10-23 Thread Rui Barradas
Hello, Try the following. y=c(2,3,5,2,4,6,8,3,6,2,5) first - function(x) min(which(x)) prefix - function(x, v) x[seq_len(v)] suffix - function(x, v) x[-seq_len(v)] first(y 4) prefix(y, first(y 4)) suffix(y, first(y 4)) Hope this helps, Rui Barradas Em 23-10-2012 10:21, Al Ehan escreveu:

Re: [R] vector indexing

2012-10-23 Thread Duncan Murdoch
On 12-10-23 5:39 AM, Rui Barradas wrote: Hello, Try the following. y=c(2,3,5,2,4,6,8,3,6,2,5) first - function(x) min(which(x)) prefix - function(x, v) x[seq_len(v)] suffix - function(x, v) x[-seq_len(v)] first(y 4) prefix(y, first(y 4)) suffix(y, first(y 4)) Be careful with this: it

Re: [R] vector is not assigned correctly in for loop

2012-10-07 Thread 周果
Thank you all for helping me out. As Michael points out, I abused the rounding and formatting of print() while debugging. The default number of digits to print is 7 according to ?print.default, which makes floating point numbers to be somewhat plausible for index vector subsetting at first glance:

[R] vector is not assigned correctly in for loop

2012-10-06 Thread 周果
Hi there, Here is a minimum working example: lower = 0 upper = 1 n_bins = 50 interval = (upper - lower) / n_bins bins = vector(mode=numeric, length=n_bins) breaks = seq(from=lower + interval, to=upper, by=interval) for(idx in

Re: [R] vector is not assigned correctly in for loop

2012-10-06 Thread Berend Hasselman
On 06-10-2012, at 08:14, 周果 guo.c...@gmail.com wrote: Hi there, Here is a minimum working example: lower = 0 upper = 1 n_bins = 50 interval = (upper - lower) / n_bins bins = vector(mode=numeric, length=n_bins) breaks =

Re: [R] vector is not assigned correctly in for loop

2012-10-06 Thread R. Michael Weylandt
Forgot to cc the list. RMW On Sat, Oct 6, 2012 at 11:29 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: A case study of a good question! Would that all posters did such a good job. On Sat, Oct 6, 2012 at 7:14 AM, 周果 guo.c...@gmail.com wrote: Hi there, Here is a minimum working

Re: [R] vector is not assigned correctly in for loop

2012-10-06 Thread Rui Barradas
Hello, This seems to be a case for FAQ 7.31 Why doesn't R think these numbers are equal? See this example: 3/5 - 1/5 - 2/5 # not zero 3/5 - (1/5 + 2/5) # not zero, different from above In your case, try for(idx in breaks){ print(idx / interval, digits = 16) # see problem indices

Re: [R] vector is not assigned correctly in for loop

2012-10-06 Thread Bert Gunter
But the OP should not be doing this **at all.** He apparently has not bothered to read the Intro to R tutorial as he appears not to know about vectorized calculations. -- Bert On Sat, Oct 6, 2012 at 3:29 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Forgot to cc the list. RMW On

Re: [R] vector is not assigned correctly in for loop

2012-10-06 Thread R. Michael Weylandt
On Sat, Oct 6, 2012 at 3:23 PM, Bert Gunter gunter.ber...@gene.com wrote: But the OP should not be doing this **at all.** He apparently has not bothered to read the Intro to R tutorial as he appears not to know about vectorized calculations. -- Bert I don't really think that's relevant or

Re: [R] Vector size limit for table() in R-2.15.1

2012-08-10 Thread peter dalgaard
On Aug 10, 2012, at 07:30 , Sean Ruddy wrote: Thanks for the help all! Good to know that there's an answer. Unfortunately, I don't have the rights to install programs so I wasn't able to try devel and I've never heard of R patched but I'm guessing I can't install that either. I'll see if

[R] Vector size limit for table() in R-2.15.1

2012-08-09 Thread Sean Ruddy
Hi, First, thanks in advance. Some useful info: version platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu version.string R version 2.15.1 (2012-06-22) I'm trying to use the table() function on a 2 column matrix that has 711

Re: [R] Vector size limit for table() in R-2.15.1

2012-08-09 Thread David Winsemius
On Aug 9, 2012, at 5:29 PM, Sean Ruddy wrote: Hi, First, thanks in advance. Some useful info: version platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu version.string R version 2.15.1 (2012-06-22) I'm trying to use the

Re: [R] Vector size limit for table() in R-2.15.1

2012-08-09 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 9, 2012, at 7:29 PM, Sean Ruddy srudd...@gmail.com wrote: Hi, First, thanks in advance. Some useful info: version platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu version.string R version 2.15.1

Re: [R] Vector size limit for table() in R-2.15.1

2012-08-09 Thread Prof Brian Ripley
As the posting guide asked you to before posting, try R-patched. That has the NEWS items • duplicated(), unique() and similar now support vectors of lengths above 2^29 on 64-bit platforms. • unique() and similar would infinite-loop if called on a vector of length 2^29

Re: [R] Vector size limit for table() in R-2.15.1

2012-08-09 Thread Sean ruddy
Thanks for the help all! Good to know that there's an answer. Unfortunately, I don't have the rights to install programs so I wasn't able to try devel and I've never heard of R patched but I'm guessing I can't install that either. I'll see if I can get someone to do that. Much appreciated!

[R] vector entry in matix

2012-07-05 Thread Thomas C.
hi, i'm trying to figure out if there's any possibility to write a whole vector into a matrix or data.frame or something like that. i don't mean transormation. Here an example: [,1] [,2] [1,] a d [2,] b e [3,] c f where e.g. a is a-c(0,1) vector of length 2, b a vector of length 4,...

Re: [R] vector entry in matix

2012-07-05 Thread R. Michael Weylandt
It is possible to put dimensionality on a list (i.e., a generic vector), which might be what you're looking for. x - list(1:4, letters[1:4], function(x,y) x + y, rnorm(50)) dim(x) - c(2,2) x[[1,2]] x[[2,2]] x[[3,2]] # Error Best, Michael On Thu, Jul 5, 2012 at 8:19 AM, Thomas C.

Re: [R] vector entry in matix

2012-07-05 Thread David Winsemius
On Jul 5, 2012, at 11:22 AM, R. Michael Weylandt wrote: It is possible to put dimensionality on a list (i.e., a generic vector), which might be what you're looking for. x - list(1:4, letters[1:4], function(x,y) x + y, rnorm(50)) dim(x) - c(2,2) x[[1,2]] x[[2,2]] x[[3,2]] # Error That

Re: [R] vector entry in matix

2012-07-05 Thread Thomas C.
well thank you, i think we get closer to my problem. but i meant it in a different way. maybe i describe what i intended to do: i have number of triangles which i'd like to store in a list, matrix,...etc. i thought it could look sth. like that: trianglenode1node2

Re: [R] vector entry in matix

2012-07-05 Thread arun
NA ... z2-as.matrix(z) A.K. - Original Message - From: Thomas C. thomas.csa...@gmail.com To: r-help@r-project.org Cc: Sent: Thursday, July 5, 2012 9:19 AM Subject: [R] vector entry in matix hi, i'm trying to figure out if there's any possibility to write a whole vector into a matrix

Re: [R] vector entry in matix

2012-07-05 Thread Bert Gunter
You have failed to provide a complete, coherent description of what you wish to do. In the absence of such a description, all suggestions are just guesses. You need to think carefully about what information you want to associate with each triangle and the appropriate data structure to use to do

Re: [R] vector entry in matix

2012-07-05 Thread Christian Brechbühler
To second Bert Gunter: you may get better answers if you give us a complete description. On Thu, Jul 5, 2012 at 12:37 PM, Thomas C. thomas.csa...@gmail.com wrote: i have number of triangles which i'd like to store in a list, matrix,...etc. i thought it could look sth. like that: triangle

Re: [R] vector entry in matix

2012-07-05 Thread Joshua Wiley
Hi Thomas, This is non trivial to do, but if you will be working with this sort of data and are inclined to do some programming, you might consider creating a new class. S4 classes and methods are quite flexible, and you can allow them to lean on or inherit from existing classes such as

Re: [R] vector w/o arithmetic addition for boxplot

2012-05-16 Thread Uwe Ligges
On 15.05.2012 23:47, rl269 wrote: Hello, I am having trouble asking R to read individual numeric vectors for a box plot of the residuals of a linear regression. It is performing arithmetic addition on the 16 individual variables that I want individual box plots for. I have 16

[R] vector w/o arithmetic addition for boxplot

2012-05-15 Thread rl269
Hello, I am having trouble asking R to read individual numeric vectors for a box plot of the residuals of a linear regression. It is performing arithmetic addition on the 16 individual variables that I want individual box plots for. I have 16 race*treatment variables that were created from

[R] vector subtraction

2012-04-20 Thread uday
I would like to calculate vector from existing value e.g v - 1000 s - 30 d1- v-s d1- 970 d2- d1 -s d2- 940 d 3 - d2-s d3- 910 : : d15 - . so how I should get vector of length 15 d

Re: [R] vector subtraction

2012-04-20 Thread R. Michael Weylandt
You're thinking about it wrong. This is an arithmetic sequence: seq(from = 1000, by = -30, length.out = 15) Michael On Fri, Apr 20, 2012 at 5:14 AM, uday uday_143...@hotmail.com wrote: I would like to calculate vector from existing  value e.g v       - 1000 s       - 30 d1    - v-s      

Re: [R] Vector errors and missing values

2012-03-05 Thread Petr PIKAL
Hi Here is my code: ##Centering predictors### verbal.ability_C - verbal.ability - mean(verbal.ability) children_C - children - mean(children) age_C - age - mean(age) education_C - education - mean(education) work.from.home.frequency_C - work.from.home.frequency -

Re: [R] Vector errors and missing values

2012-03-05 Thread jahughes81
Hi Petr, Thank you so much for your help. You're right, the issue was that I needed to center my predictors by adding the code 'na.rm=T': verbal.ability_C - verbal.ability - mean(verbal.ability, na.rm=T) That removed the NA values from being included in my centering and allowed me to run the

Re: [R] Vector errors and missing values

2012-03-02 Thread Petr PIKAL
Hi Hi, I am trying to run two Non-Gaussian regressions: logistic and probit. I am receiving two different errors when I try to run these regressions and I am not sure what they mean or how to fix my syntax. Here is the logistic regression error: Error in family$linkfun(mustart) :

Re: [R] Vector errors and missing values

2012-03-02 Thread jahughes81
Hi Petr! Thank you for responding to my post. I checked out all my variables in the way you suggested and they are all in integer form, but here are many missing values in some of my vectors, denoted with NA. So, they are in the correct form, I am just wondering if there is something else I

Re: [R] Vector errors and missing values

2012-03-02 Thread Petr PIKAL
Hi Hi Petr! Thank you for responding to my post. I checked out all my variables in the way you suggested and they are all in integer form, but here are many missing values in some of my vectors, denoted with NA. So, they are in the correct form, I am just wondering if there is

Re: [R] Vector errors and missing values

2012-03-02 Thread jahughes81
Here is my code: ##Centering predictors### verbal.ability_C - verbal.ability - mean(verbal.ability) children_C - children - mean(children) age_C - age - mean(age) education_C - education - mean(education) work.from.home.frequency_C - work.from.home.frequency -

[R] Vector errors and missing values

2012-03-01 Thread jahughes81
Hi, I am trying to run two Non-Gaussian regressions: logistic and probit. I am receiving two different errors when I try to run these regressions and I am not sure what they mean or how to fix my syntax. Here is the logistic regression error: Error in family$linkfun(mustart) : Argument mu

[R] Vector manipulation

2012-02-12 Thread syrvn
Hello, I am stuck with the following problem. Consider the vector: vec - c(2,4,6,9,10) I now want to use R to manipulate the vector as follows: [1] 2, 4, 2, 6, 2, 9, 2, 10 In words, the first element of the vector should be placed in front of each following number. Which R commands do I

Re: [R] Vector manipulation

2012-02-12 Thread Dimitris Rizopoulos
One way is: vec - c(2,4,6,9,10) c(rbind(vec[1], vec[-1])) I hope it helps. Best, Dimitris On 2/12/2012 6:54 PM, syrvn wrote: Hello, I am stuck with the following problem. Consider the vector: vec- c(2,4,6,9,10) I now want to use R to manipulate the vector as follows: [1] 2, 4, 2, 6,

Re: [R] Vector manipulation

2012-02-12 Thread Jorge I Velez
Hi mentor_, Try c(sapply(vec[-1], function(x) c(vec[1], x))) # [1] 2 4 2 6 2 9 2 10 HTH, Jorge.- On Sun, Feb 12, 2012 at 12:54 PM, syrvn wrote: Hello, I am stuck with the following problem. Consider the vector: vec - c(2,4,6,9,10) I now want to use R to manipulate the vector

Re: [R] Vector manipulation

2012-02-12 Thread syrvn
Great Dimitris. It helps indeed! Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/Vector-manipulation-tp4381586p4381614.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] vector

2011-12-01 Thread Sarah Goslee
Hi, On Thu, Dec 1, 2011 at 10:35 AM, Majid golden_boy...@yahoo.com wrote: Hi. Can you please answer to my questions about R ? 1.how can I write command for vector ? for exaple in this sample : I have this : a1 - c (1:10) now how can I put in the vector ? I'm afraid I don't understand

  1   2   3   >