similar to: How to define format of number

Displaying 20 results from an estimated 7000 matches similar to: "How to define format of number"

2012 Mar 31
3
clear console
hi, I use R - 2.15(32bit), and want to make a code to clear a console. Actually, I used to run following code to do that but after update the version of R from 2.14 to 2.15, it doesn't work. cls <- function (t) { require(RDCOMClient) wsh <- COMCreate("Wscript.Shell") wsh$SendKeys("\f") invisible(wsh) } cls() or cls <-
2012 Feb 27
5
macro function
hi, I know how to use the "for" loop function like: for(i in 1:ncol(mat)){ mat[i]<-b[i,2] } but, in this case r1<-b[1,1] r2<-b[2,1] r3<-b[3,1] r4<-b[4,1] * * * r3002<-b[3002,1] r3003<-b[3003,1] - must make vectors how should I make a efficient code for that? Is there anything in R like SAS MACRO function? Please help me. -- View this message in context:
2012 Mar 12
2
erasing "[1]"
hi, is there any way to erase the term "[1]"? for example, > a<-3+2 > a *[1]* 5 the term [1] in front of number 5. is there any way? -- View this message in context: http://r.789695.n4.nabble.com/erasing-1-tp4467628p4467628.html Sent from the R help mailing list archive at Nabble.com.
2012 Nov 03
3
to print system.time always
Hi all; I want to print system.time whenever I execute any command. It takes too much time to type "system.time()" function to all command. is there any solution on it? And, apply(matrix,1,cumsum) command is too slow to some large matrix. is there any function like rowCumSums ? thank u! -- View this message in context:
2012 Mar 16
2
how to speed up the inefficient code
hi, i'm really in trouble to simulate some experiment. that is, it takes too much time to process the following code. following is short example, ------------------------------------------------------------------------------------------------------- p<-data.frame(a=rnorm(10),b=rnorm(10),c=rnorm(10),d=rnorm(10)) test<-data.frame(a=rnorm(1),b=rnorm(1),c=rnorm(1),d=rnorm(1))
2012 Nov 22
1
rapache memory problem
Hi all; Now I'm developing web application by using rapache in ubuntu. My problem is that as users execute the application, the server PC cumulates memory. After users close or refresh the application page, the server PC memory is still cumulated. Now I'm renewing apache machine by manually in terminal. Is there any way to kill memory when users refresh or close the application page?
2012 Mar 15
2
how to hide code of any function
hi I'm making some program and it need to be hidden. it's not commercial purpose but it is educational, so i do want to hide the code of function. for example, if i made following function: a<-function(x){ y<-x^2 print(y) } i do not want someone to type "a" and take the code of the function. is there anyone who can help me? -- View this message in context:
2012 Mar 16
1
how to speed up the process of R
hi I'm simulating some experiment by "for" function. The problem is that it takes too much time. for example, a<-list() for(i in 1:100000000){ a[[i]]<-i*1000 } is there anyway to speed up the process? I heard there is solution but i don't have idea. Can anyone help me? -- View this message in context:
2012 Oct 14
1
stop at error point in for-loop
hi all: Following is simple example, for(i in 1:10000000){ a<-function(i){ #some function that has an error } } What I want to know is the way to find the error point in for-loop, What "i" makes the error. is there any way to solve it instead of debugging and finding an error manually? Thanks, -- View this message in context:
2012 Mar 15
1
how to assign "writeLines" function
hi, what I want to do is assigning following code to any object. k<-paste("thank") writeLines(strwrap(k, width = 80,indent = 7,exdent = 6)) To assign the "writeLines" code, I try this a<-writeLines(strwrap(k, width = 80,indent = 7,exdent = 6)) or assign(a,writeLines(strwrap(k, width = 80,indent = 7,exdent = 6))) but it doesn't work. is there any way to solve
2012 Mar 22
1
how to adjust gui window size
hi, i'm trying to make gui function by "aDialog" FUN. What i want to do is adjusting the window size. my function is , aa<- aDialog(items=list( ps=numericItem(), number=numericItem(), term=numericItem() ), OK_handler=function(.) { # . is reference to dlg object values <- .$to_R() do.call("KOD",values) } ) how can i adjust the size of the window? Thanks~ -- View
2012 Mar 24
1
how to make output more lovely
Hi, I'm trying to make output of my function easier to see and more lovely. As u know, R output is not easy to see for beginner of study or anyone not expert so I want to transform the output into other form. Output of my function is just long text with some numerical result and table. Is there a way to solve it? Thanks. -- View this message in context:
2019 Mar 21
3
prettyNum digits=0 not compatible with scientific notation
R developers, Seems I get a bad result ("%#4.0-1e" in particular) when trying to use prettyNum digits=0 with scientific notation. I tried on both my Linux box and on an online R evaluator and saw the same problem, so it's not limited to my box at least. I see the problem in both R 3.5.3 and R 3.3.2. options(scipen=-100) prettyNum(1, digits=0) [1] "%#4.0-1e" prettyNum(2,
2019 Mar 22
2
prettyNum digits=0 not compatible with scientific notation
FWIW, it doesn't seem to be happening on Mac OS: > format(2^30, digits=0) [1] "1.e+09" > prettyNum(12345.6, digits=0) [1] "1.e+04" A glibc misfeature? -pd > On 22 Mar 2019, at 10:10 , Martin Maechler <maechler at stat.math.ethz.ch> wrote: > > Thank you, Robert for raising this here ! > >>>>>> Robert McGehee
2018 May 25
4
options other than regex
Hi -- I'm looking for alternatives to regex for a fairly simply 'reformatting' problem. Alternatives only because a lot of folks have trouble parsing/interpreting regex expressions, and I'm looking for suggestions for something more 'transparent'. Here is an example of what I'm trying to do. Take the following string, which I call x, and for each character in the
2013 Apr 08
3
SVD on very large data matrix
Dear All, I need to perform a SVD on a very large data matrix, of dimension ~ 500,000 x 1,000 , and I am looking for an efficient algorithm that can perform an approximate (partial) SVD to extract on the order of the top 50 right and left singular vectors. Would be very grateful for any advice on what R-packages are available to perform such a task, what the RAM requirement is, and indeed what
2008 Aug 07
1
Bug in format.default(): na.encode does not have any effect for (PR#12318)
Hi! If I use format() on numeric vector, na.encode argument does not have any e= ffect. This was reported before: - https://stat.ethz.ch/pipermail/r-help/2007-October/143881.html - http://tolstoy.newcastle.edu.au/R/e2/devel/06/09/0360.html It works for other (say character) classes! > format(c("a", NA), na.encode=3DTRUE) [1] "a " "NA" >
2018 May 25
0
options other than regex
Hi I am not sure if it is more readable > paste(paste(unlist(strsplit(x,"")),".", sep=""), collapse="") [1] "1.0.1.1.0.1.1.1." If you did not want last dot, it is a bit shorter. > paste(unlist(strsplit(x,"")),collapse=".") [1] "1.0.1.1.0.1.1.1" > Cheers Petr Tento e-mail a jak?koliv k n?mu p?ipojen?
2009 Nov 13
2
format (PR#14062)
Full_Name: Dirk Jacob Version: R 2.8.1 and 2.9.1 OS: Win XP Submission from: (NULL) (153.96.32.62) I want to convert numbers to strings like: > inputs= c(0.3+0*(1:12) ) > (format(inputs,digits=3,scientific=T,collapse=" ")) and it works [1] "3e-01" "3e-01" "3e-01" "3e-01" "3e-01" "3e-01" "3e-01"
2002 May 13
1
prettyNum inserts leading commas (PR#1548)
Under R-1.5.0 on Solaris 2.6: R> prettyNum(123456789, big.mark=",") [1] ",123,456,789" and that bad behavior (leading comma) spills into formatC as well: R> formatC(123456789, digits=0, format="f", big.mark=",") [1] ",123,456,789" Looks to me like a bug in src/library/base/R/format.R, in function prettyNum: B.[i.big] <-