Displaying 20 results from an estimated 30000 matches similar to: "sprintf("%c",...)"
2006 Mar 11
6
is there a formatted output in R?
something like "sprintf" in C?
so I can do:
print(sprintf("the correct result is %3.4f\n", myresult));
-------
Also, I am desperately looking for a "clear console screen" function in
R...
thanks a lot!
[[alternative HTML version deleted]]
2006 Jul 09
3
vignette("introduction") causes "Error in sprintf(" (PR#9069)
Full_Name: Chris Evans
Version: 2.3.1
OS: Windoze XP
Submission from: (NULL) (217.34.100.197)
If I give "vignette("introduction")" I get:
Error in sprintf(gettext(fmt, domain = domain), ...) :
use format %s for character objects
vignette() works for some other vignettes and "vignette()" gets me a list of
vignettes and shows three with the name
2006 Mar 25
7
Regexp subexpression
I can't get the PERL subexpression translated to R. Following, for example,
B. Ripley's
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/58984.html
I am using sub, but it looks like an ugly substitute. Assume I want to
extract the first alpha part and the first numeric part, but only if they
are in sequence.
Do I really have to use the sub twice, first extracting the first variable,
then
2008 Nov 02
5
R newbie: how to replace string/regular expression
Hello;
I am a R newbie and would like to know correct and efficient method for
doing string replacement.
I have a large data set, where I want to replace character "M", "b",
and "K" (currency in Million, Billion and K) to millions. That is
209.7B with (209.7 * 10e6) and 100.00K with (100.00 *1/100)
and etc..
d <- c("120.0M", "11.01m",
2007 Oct 03
1
inverse of matrix made by low.tri function
Hi all,
I am using R trying to get a inverse matrix of (X^T)X , but I keep getting
the error
message like: no b argument and no default value for sprintf(gettext(fmt,
domain = domain), ...) .
--------------------------------------------------------------------------------------------
# my code
X<-Matrix(rep(1,500),100,5)
X[lower.tri(X)]<-1-10^-7
XtX<- t(X)%*% X
XtXu<-lu(XtX)
2024 Mar 02
1
capture "->"
Would it be good enough to pass it as a formula? Using your definition of foo
foo(~ A -> result)
## result <- ~A
foo(~ result <- A)
## ~result <- A
On Fri, Mar 1, 2024 at 4:18?AM Dmitri Popavenko
<dmitri.popavenko at gmail.com> wrote:
>
> Hi everyone,
>
> I am aware this is a parser issue, but is there any possibility to capture
> the use of the inverse
2006 Dec 04
2
ask for help
Dear Sir
I would appreciate recieving the manul instruction of the program foe geochemical calculations.please what are the requirmentsof using the program
Thanks
Tanat university faculty of science , geology department ,tanta Egypt
Prof.Mohamed Fouad Ghoneim
Ph.D- D.Sc.
Head of Geology Department
Faculty of Science
Tanta University, Egypt
www.profghoneim.tk
2003 Sep 07
4
data manipulation
Hi,
I am new to R, coming from a few years using Stata. I've been twisting my
brain and checking several R and S references over the last few days to
try to solve this data management problem: I have a data set with a unique
patient identifier that is repeated along multiple rows, a variable with
month of patient encounter, and a continous variable for cost of
individual encounters. The data
2007 Jan 18
4
Reading contingency tables
I am trying to read an ftable using read.ftable, but I get the
following error message:
> jobSatTable <- read.ftable("http://definetti.uark.edu/~gpetris/stat5333/jobSatisfaction.dat",skip=2)
Error in seek(file, where = 0) : no applicable method for "seek"
In addition: Warning messages:
1: no non-missing arguments to max; returning -Inf
2: no non-missing arguments to
2006 Jul 11
4
Date Format
Hi everybody,
I need your precious help for, I think, a simple request, but I do not manage to solve this.
When I use a "table" function with dates in the rows, the rows are coerced to number after the table function.
So I need to transform the row names into date format. But I do not manage.
Therefore, for an example, I manage to write this :
datetest<-"06/01/2001"
2006 Jul 11
4
Date Format
Hi everybody,
I need your precious help for, I think, a simple request, but I do not manage to solve this.
When I use a "table" function with dates in the rows, the rows are coerced to number after the table function.
So I need to transform the row names into date format. But I do not manage.
Therefore, for an example, I manage to write this :
datetest<-"06/01/2001"
2011 Sep 12
5
Hourly data with zoo
I have date data as a numeric and hourly data in 0 to 2300 hours in a dataframe.
d <- rep(20110101,24)
h <- seq(from = 0, to = 2300, by = 100)
df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1))
S <- chron(dates. = as.character(df$LST_DATE), times. =
paste(as.character(df$LST_TIME/100), ":0:0", sep = ""),
format =
2004 Feb 16
4
Matrix mulitplication
ABCD are four matrix.
A * Inverse((Transpose(A)*Tranpose(B)*B*A+C)) * Transpose(A) * Transpose(B) * D
how to write in R in an efficient way?
---------------------------------
[[alternative HTML version deleted]]
2004 Feb 23
2
orthonormalization with weights
Hello List,
I would like to orthonormalize vectors contained in a matrix X taking into
account row weights (matrix diagonal D). ie, I want to obtain Z=XA with
t(Z)%*%D%*%Z=diag(1)
I can do the Gram-Schmidt orthogonalization with subsequent weighted
regressions. I know that in the case of uniform weights, qr can do the
trick. I wonder if there is a way to do it in the case of non uniform
2024 Mar 04
1
[External] Re: capture "->"
It seems like you want to use -> and <- as arrows with different meanings
to "A gets the value of B" in your package, as a means of writing
expressions in your package language.
Another possibility would be to use different symbols instead of the
problematic -> and <-, for example you could use <.~ and ~.> which are not
at all flipped or changed before you get a chance
2010 Jul 26
7
Bug on r-bc?
Dear All,
The following code should return 1, but it returns 0:
source("http://r-bc.googlecode.com/svn/trunk/R/bc.R")
bc("9 % 2")
Do you confirm this bug?
Paul
2009 Mar 20
1
sprintf causes a segfault (PR#13613)
Full_Name: Wacek Kusnierczyk
Version: 2.8.0 and 2.10.0 r48163
OS: Ubuntu 8.04 Linux 32bit
Submission from: (NULL) (129.241.198.172)
the following code illustrates a problem with sprintf which consistently causes
a segfault when applied to certain type of arguments. it also shows
inconsistent consequences of the segfault:
(e = tryCatch(stop(), error=identity))
# e is an error object
2004 Dec 24
6
Sorting problem
Hi
I'm using R 2.0 in SuSE 9.2.
When I plot data as a boxplot, the boxes appear on the plot in
alphabetical order (of group) rather than the order in which they appear
in the data. So far, the only thing I can do to fix this is to prefix
the group labels with a,b,c...etc to trick R into plotting them in the
right order.
Can sorting be turned off?
How should I address this sensibly?
Thanks
2009 Mar 18
1
sprintf("%d", integer(0)) aborts
In R's sprintf() if any of the arguments has length 0
the function aborts. E.g.,
> sprintf("%d", integer(0))
Error in sprintf("%d", integer(0)) : zero-length argument
> sprintf(character(), integer(0))
Error in sprintf(character(), integer(0)) :
'fmt' is not a non-empty character vector
This comes up in code like
x[nchar(x)==0] <-
2008 Nov 29
2
Using grep() to subset lines of text
I have two vectors, a and b. b is a text file. I want to find in b those
elements of a which occur at the beginning of the line in b. I have the
following code, but it only returns a value for the first value in a, but I
want both. Any ideas please.
a = c(2,3)
b = NULL
b[1] = "aaa 2 aaa"
b[2] = "2 aaa"
b[3] = "3 aaa"
b[4] = "aaa 3 aaa"