Hi,
I guess I was not clear enough: the name of the function is stored as
string. Solutions which use the object directly do not help unfortunately.
Thanks Sigbert
Am 27.09.2018 um 12:30 schrieb Sigbert Klinke:
Hi,
I want to have a function, e.g. graphics::box, as text.
Currently I'am using
Hi
If you do not require the zeros to the right in the scientific notation
x
[1] 5.2e-01 1.7e-01 3.0e-02 1.0e-20
zapsmall(x)
[1] 0.52 0.17 0.03 0.00
Then use format, formatC or sprintf for character conversions
Regards
Duncan
Duncan Mackay
Department of Agronomy and Soil Science
Universit
Bugger! It's
eval(parse(text=paste0("kkdf[c(",paste(starts,ends,sep=":",collapse=","),"),]")))
What a mess!
Jim
On Fri, Sep 28, 2018 at 8:35 AM Jim Lemon wrote:
>
> Hi Knut,
> As Bert said, you can start with diff and work from there. I can
> easily get the text for the subset, but despite fool
Hi Knut,
As Bert said, you can start with diff and work from there. I can
easily get the text for the subset, but despite fooling around with
"parse", "eval" and "expression", I couldn't get it to work:
# use a bigger subset to test whether multiple runs can be extracted
kkdf<-subset(airquality,Te
First compare
> format(c(0.52, 0.17, 0.03, 1e-20))
[1] "5.2e-01" "1.7e-01" "3.0e-02" "1.0e-20"
> prettyNum(c(0.52, 0.17, 0.03, 1e-20))
[1] "0.52" "0.17" "0.03" "1e-20"
>
If you want to print one column at a time, that will do what you ask. If you
want to print the entire data frame, with num
> On Sep 27, 2018, at 9:35 AM, David Disabato wrote:
>
> Hi R-help,
>
> I was wondering if it was possible for a column of a dataframe to print
> some numbers in standard notation and some in scientific notation. Say my
> column of data (i.e., dat$x) has numbers between 0 and 1 with a few numb
Hi R-help,
I was wondering if it was possible for a column of a dataframe to print
some numbers in standard notation and some in scientific notation. Say my
column of data (i.e., dat$x) has numbers between 0 and 1 with a few numbers
very close to 0. When using the "scipen" argument in "options," R
deparse(graphics::box)
/Henrik
On Thu, Sep 27, 2018 at 3:30 AM Sigbert Klinke
wrote:
>
> Hi,
>
> I want to have a function, e.g. graphics::box, as text.
> Currently I'am using
>
> deparse(eval(parse(text='graphics::box')))
>
> It is important that '::' and ':::' can be used in the name.
>
> Is th
Or
sink('stuff.txt') ; graphics::box ; sink()
to have it in a text file.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
On 9/27/18, 4:55 AM, "R-help on behalf of Rui Barradas"
wrote:
Hello,
On Thu, 27 Sep 2018, Swapan Kumar Tripathy wrote:
I have successfully installed R, but could not install the R/qtl. There is
instruction that "To install R/qtl, the simplest approach is to start R
and type install.packages("qtl"). But, I do not find any step where to
type install.packages("qtl")
Am 27.09.2018 um 17:02 schrieb Swapan Kumar Tripathy:
Sir,
I have successfully installed R, but could not install the R/qtl.
There is instruction that "To install R/qtl, the simplest approach is to
start R and type install.packages("qtl"). But, I do not find any step where
to type install.package
Dear all,
I am using R 3.4.3 on Windows 10. I am writing code to use in a forthcoming
teaching session. As part of the workshop the students are using breast cancer
data made available by Patrick Royston and available from
http://www.statapress.com/data/fpsaus.html (I didn't pick the dataset
Sir,
I have successfully installed R, but could not install the R/qtl.
There is instruction that "To install R/qtl, the simplest approach is to
start R and type install.packages("qtl"). But, I do not find any step where
to type install.packages("qtl") during the process of installing R.
Kindly, ad
1. I assume the values are integers, not floats/numerics (which woud make
it more complicated).
2. Strategy: Take differences (e.g. see ?diff) and look for >3 1's in a
row.
I don't have time to work out details, but perhaps that helps.
Cheers,
Bert
Bert Gunter
"The trouble with having an open
Hello,
As for R^2 in Excel for models without an intercept, maybe the following
are relevant.
https://support.microsoft.com/en-us/help/829249/you-will-receive-an-incorrect-r-squared-value-in-the-chart-tool-in-exc
https://stat.ethz.ch/pipermail/r-help/2012-July/318347.html
Hope this helps,
Hi to all
I need a subset for values if there are f.e 3 values successive in a
column of a Data Frame:
Example from the subset help page:
subset(airquality, Temp > 80, select = c(Ozone, Temp))
29 45 81
35 NA 84
36 NA 85
38 29 82
39 NA 87
40 71 90
41 39
This is an old discussion. The thing that R is doing is to compare the model to
the model without any regressors, which in the no-intercept case is the
constant zero. Otherwise, you would be comparing non-nested models and the R^2
would not satisfy the property of being between 0 and 1.
A simi
See also this thread in stats.stackexchange
https://stats.stackexchange.com/questions/26176/removal-of-statistically-significant-intercept-term-increases-r2-in-linear-mo
On Thu, Sep 27, 2018 at 3:43 PM, J C Nash wrote:
> This issue that traces back to the very unfortunate use
> of R-squared a
This issue that traces back to the very unfortunate use
of R-squared as the name of a tool to simply compare a model to the model that
is a single number (the mean). The mean can be shown to be the optimal choice
for a model that is a single number, so it makes sense to try to do better.
The OP ha
I have a query on the R-squared correlation coefficient for linear
regression through the origin.
The general expression for R-squared in regression (whether linear or
non-linear) is
R-squared = 1 - sum(y-ypredicted)^2 / sum(y-ybar)^2
However, the lm function within R does not seem to use this
Variations on the same theme:
> testdf<-data.frame(A=c(1,2),B=c(2,3),C=c(3,4))
> testdf[0,]
[1] A B C
<0 rows> (or 0-length row.names)
> testdf[FALSE,]
[1] A B C
<0 rows> (or 0-length row.names)
> testdf[integer(0),]
[1] A B C
<0 rows> (or 0-length row.names)
> testdf[NULL,]
[1] A B C
<0 rows> (or
Hello,
Maybe
capture.output(graphics::box)
Hope this helps,
Rui Barradas
Às 11:30 de 27/09/2018, Sigbert Klinke escreveu:
Hi,
I want to have a function, e.g. graphics::box, as text.
Currently I'am using
deparse(eval(parse(text='graphics::box')))
It is important that '::' and ':::' can be
Hi,
I want to have a function, e.g. graphics::box, as text.
Currently I'am using
deparse(eval(parse(text='graphics::box')))
It is important that '::' and ':::' can be used in the name.
Is there a simpler way?
Thanks
Sigbert
--
https://hu.berlin/sk
https://hu.berlin/mmstat3
Hi Luigi,
Actually I doubt that the original problem you try to solve requires the
initialization of an empty data.frame with a particular structure.
However, if you think you really need this step, I would write a
function for it and also consider edge cases.
getSkeleton <- function(x, drop
I never bother with the dimensions of a data frame . That way you can assign
a new var before a for and auto assign it columns inside or nullify the
whole df instead of separate columns?
BR
-Original Message-
From: R-help <> On Behalf Of Jim Lemon
Sent: Thursday, September 27, 2018 2:06
Or
testdf <- testdf[FALSE, ]
or
testdf <- testdf[numeric(0), ]
which seems to be slightly faster.
Best,
Jan
Op 27-9-2018 om 10:32 schreef PIKAL Petr:
Hm
I would use
testdf<-data.frame(A=c(1,2),B=c(2,3),C=c(3,4))
str(testdf)
'data.frame': 2 obs. of 3 variables:
$ A: num 1 2
$ B:
You're right. Apparently one can form a list with NULL elements but
not a data frame. I just saw Petr's answer, which seems to do the
trick.
Jim
On Thu, Sep 27, 2018 at 6:19 PM Luigi Marongiu wrote:
>
> I am not sure if I got it right; Now I get:
>
> > toNull<-function(x) return(NULL)
> > df<-a
Hm
I would use
> testdf<-data.frame(A=c(1,2),B=c(2,3),C=c(3,4))
> str(testdf)
'data.frame': 2 obs. of 3 variables:
$ A: num 1 2
$ B: num 2 3
$ C: num 3 4
> testdf<-testdf[-(1:nrow(testdf)),]
> str(testdf)
'data.frame': 0 obs. of 3 variables:
$ A: num
$ B: num
$ C: num
Cheers
Petr
Ah, yes, try 'as.data.frame" on it.
Jim
On Thu, Sep 27, 2018 at 6:00 PM Luigi Marongiu wrote:
>
> Thank you Jim,
> this requires the definition of an ad hoc function; strange that R
> does not have a function for this purpose...
> Anyway, it works but it changes the structure of the data. By
> r
Hi Luigi,
Maybe this:
testdf<-data.frame(A=1,B=2,C=3)
> testdf
A B C
1 1 2 3
toNull<-function(x) return(NULL)
testdf<-sapply(testdf,toNull)
Jim
On Thu, Sep 27, 2018 at 5:29 PM Luigi Marongiu wrote:
>
> Dear all,
> I would like to erase the content of a dataframe -- but not the
> dataframe itsel
Dear all,
I would like to erase the content of a dataframe -- but not the
dataframe itself -- in a simple and fast way.
At the moment I do that by re-defining the dataframe itself in this way:
> df <- data.frame(A = numeric(),
+ B = numeric(),
+ C = character())
31 matches
Mail list logo