Displaying 20 results from an estimated 30000 matches similar to: "svn version number"
2003 Nov 05
1
save(iris,file=
I tried it using file and it seems to work for saving:
> data(iris)
> con <- file("clipboard","w")
> save(iris,ascii=T,file=con)
> close(con)
> readLines("clipboard")
... lengthy output follows which seems correct ...
but not for loading:
> con <- file("clipboard","r")
> load(con)
Error in load(con) : loading from
2004 Mar 18
12
substitute question
Consider the following example:
# substitute a with b in the indicated function. Seems to work.
> z <- substitute( function()a+1, list(a=quote(b)) )
> z
function() b + 1
# z is an object of class call so use eval
# to turn it into an object of class expression; however,
# when z is evaluated, the variable a returns.
> eval(z)
function()a+1
Why did a suddenly reappear again
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
2024 Sep 08
2
Inconsistency between row and nrow
Hi Gabor,
In strictly reading the help files for both nrow() and row(), the 'x' argument in the former case is "a vector, array, data frame, or NULL.", whereas in the latter case it is "a matrix-like object, that is one with a two-dimensional dim.".
Thus, I would expect row() to fail on a >= 3-dimensional array, as your example shows.
In reading the help file for
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
2004 Jun 20
9
A way to list only variables or functions?
I am curious if there is any way to list only variables or functions in
current environment, rather than listing all objects? Thanks.
--
Daehyok Shin (Peter)
Geography Department
Univ. of North Carolina-Chapel Hill
2004 Jun 20
9
A way to list only variables or functions?
I am curious if there is any way to list only variables or functions in
current environment, rather than listing all objects? Thanks.
--
Daehyok Shin (Peter)
Geography Department
Univ. of North Carolina-Chapel Hill
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
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"
2023 Nov 14
1
data.frame weirdness
Also why should that difference result in different behavior?
On Tue, Nov 14, 2023 at 9:38?AM Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
>
> In that case identical should be FALSE but it is TRUE
>
> identical(a1, a2)
> ## [1] TRUE
>
>
> On Tue, Nov 14, 2023 at 8:58?AM Deepayan Sarkar
> <deepayan.sarkar at gmail.com> wrote:
> >
> >
2024 Jul 22
3
Extract
Base R. Regarding code improvements:
1. Personally I find (\(...) ...)() notation hard to read (although by
placing (\(x), the body and )() on 3 separate lines it can be improved
somewhat). Instead let us use a named function. The name of the
function can also serve to self document the code.
2. The use of dat both at the start of the pipeline and then again
within a later step of the pipeline
2018 Jan 25
6
Portable R in zip file for Windows
What is wrong with you guys? I asked for a zip, like R Studio has for
example. Totally clear.
I cant execute exes. But I can unzip files.
Thanks Gabor, I had that in mind, but can't execute the exe due to security
restrictions.
Geez, really, treating people who ask questions this way just makes you
don't want to ask a single one.
On Thu, Jan 25, 2018, 11:19 Gabor Grothendieck
2023 Nov 14
1
data.frame weirdness
On Tue, 14 Nov 2023 at 09:41, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
>
> Also why should that difference result in different behavior?
That's justifiable, I think; consider:
> d1 = data.frame(a = 1:4)
> d2 = d3 = data.frame(b = 1:2)
> row.names(d3) = c("a", "b")
> data.frame(d1, d2)
a b
1 1 1
2 2 2
3 3 1
4 4 2
> data.frame(d1,
2010 Jul 10
7
Need help on date calculation
Hi all, please see my code:
> library(zoo)
> a <- as.yearmon("March-2010", "%B-%Y")
> b <- as.yearmon("May-2010", "%B-%Y")
>
> nn <- (b-a)*12 # number of months in between them
> nn
[1] 2
> as.integer(nn)
[1] 1
What is the correct way to find the number of months between "a" and "b",
still
2018 Jan 26
2
Portable R in zip file for Windows
Pretty good question Gabor. I can execute R once it is installed (if
someone with rights installs it before) but not the installer. I can
download the installer (with some pain). I know that some installers are
actually compressed files in disguise, but I think this is not the case
with R, right?
I will study the exact nature of the restriction, and get back to you.
Nevertheless, having a
2005 May 17
4
Combinations with two part column
Dear R-helpers,
I am a beginner using R.
This is the first question in this list.
My question, Is there possible to make combinations with two part column?
If I have a number 1,2,3,4,5,6,7,8. I need the result something like below:
1,2,3,4,5 6,7,8
1,2,3,4,7 5,6,8
2,3,4,5,6 1,7,8
1,2,3,6,7 4,5,8
1,2,3,4,8 5,6,7
3,4,6,7,8 1,2,5
....
I would be very happy if anyone could
2010 Nov 24
4
R encoding question
Hi,
I am using RpgSQL to retrieve data from a PostgreSQL database wich is
with encoding UTF8, and I have some Chinese character in one of the
columns, unfortunately R can't show it correctly.
> df <- dbGetQuery(con, "select * from test")
> df
a b
1 1 ????????\xa2
2 2 ???? EURO\xa1
I see the following option, do I need to change the encoding option to
show
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]]
2007 Jul 16
5
formula(CO2)
The formula attribute of the builtin CO2 dataset seems a bit strange:
> formula(CO2)
Plant ~ Type + Treatment + conc + uptake
What is one supposed to do with that? Certainly its not suitable for
input to lm and none of the examples in ?CO2 use the above.
2005 Jun 30
5
答复: fail in adding library in new version.
Dear Gabor,
Thank your for helping me so much!
I have loaded R the newest version 2.1.1. Then I setup it in the path of D:\program files\R\
1. unpack tools.zip into c:\cygwin
2. install Active perl in c:\Perl
3. install the mingw32 in c:\mingwin
4. add "c:\cygwin; c:\mingwin\bin" in "Control Panel -> System -> Advanced -> Environment Variables -> Path ->