Displaying 20 results from an estimated 7000 matches similar to: "sourcing dput output"
2012 Aug 28
1
Don't dput() data frames?
/src/main/attrib.c contains this comment in row_names_gets():
/* This should not happen, but if a careless user dput()s a
data frame and sources the result, it will */
which svn blame says Prof Ripley placed there in r39830 with the
commit message "correct the work of dput() on the row names of a data
frame with compact representation."
Is there a problem / better way to
2018 Jul 24
2
oddity in transform
The idea is that one wants to write the line of code below
in a general way which works the same
whether you specify ix as one column or multiple columns but the naming entirely
changes when you do this and BOD[, 1] and transform(BOD, X=..., Y=...) or
other hard coding solutions still require writing multiple cases.
ix <- 1:2
transform(BOD, X = BOD[ix] * seq(6))
On Tue, Jul 24, 2018 at
2018 Jul 23
2
oddity in transform
Note the inconsistency in the names in these two examples. X.Time in
the first case and Time.1 in the second case.
> transform(BOD, X = BOD[1:2] * seq(6))
Time demand X.Time X.demand
1 1 8.3 1 8.3
2 2 10.3 4 20.6
3 3 19.0 9 57.0
4 4 16.0 16 64.0
5 5 15.6 25 78.0
6 7 19.8 42 118.8
>
2009 Sep 28
6
SAS user now converting to R - Help with Transpose
I am just starting to code in R and need some help as I am used to doing this
in SAS.
I have a dataset that looks like this:
Chemical Well1 Well2 Well3 Well4
BOD 13.2 14.2 15.5 14.2
O2 7.8 2.6 3.5 2.4
TURB 10.2 14.6 18.5 17.3
and so on with more chemicals....
I would like to transpose my data so that it looks like this:
Chemical WellID Value
BOD Well1 13.2
BOD Well2 14.2
BOD Well3 15.5
BOD
2006 Oct 10
1
error in dput applied to dataframe (PR#9286)
Full_Name: Daniel F Higgins
Version: 2.4.0
OS: Windows XP and Mac OSX
Submission from: (NULL) (128.111.242.49)
Create a dataframe as indicated below and apply 'dput' to it; note that the
row.names attribute is incorrect!
> aaa <- c("AAA","BBB","AAA")
> bbb <- c(1,2,3)
> df <- data.frame(aaa,bbb)
> dput(df)
structure(list(aaa =
2009 Aug 25
1
Help with nls and error messages singular gradient
Hi All,
I'm trying to run nls on the data from the study by Marske (Biochemical
Oxygen Demand Interpretation Using Sum of Squares Surface. M.S. thesis,
University of Wisconsin, Madison, 1967) and was reported in Bates and Watts
(1988).
Data is as follows, (stored as mydata)
time bod
1 1 0.47
2 2 0.74
3 3 1.17
4 4 1.42
5 5 1.60
6 7 1.84
7 9 2.19
8 11 2.17
I then
2007 Apr 22
1
dput/dget when a data frame has 2 rows (PR#9627)
This doesn't seem right; I'm using R version 2.4.1 (2006-12-18) on Mac OS
and Win XP and find the same issue:
> mydataframe <- data.frame(ppi=c(.5,.5),mmu=c(5,10))
> dput(mydataframe,"mydataframe.txt")
> dget("mydataframe.txt")
Error in attributes(.Data) <- c(attributes(.Data), attrib) :
row names must be 'character' or 'integer', not
2005 Feb 02
4
(no subject)
can you recommend a good manual for R that starts with a data set and gives
demonstrations on what can be done using R? I downloadedR Langauage
definition and An introduction to R but haven't found them overly useful.
I'd really like to be able to follow some tutorials using a dataset or many
datasets. The datasets I have available on R are
Data sets in package 'datasets':
2011 Nov 08
1
dbWriteTable with field data type
Hello,
When I do:
dbWriteTable(con, "r.BOD", cbind(row_names = rownames(BOD), BOD))
...can I specify the data types such as varchar(12), float, double
precision, etc. for each of the fields/columns?
If not, what is the best way to create a table with specified field data
types (with the RpgSQL package/R)?
Regards,
Ben
[[alternative HTML version deleted]]
1999 May 27
1
Factor structures not preserved after dump/dput (PR#200)
Full_Name: Marek Ancukiewicz
Version: 0.64.0
OS: Linux (RedHat 6.0)
Submission from: (NULL) (132.183.12.87)
I've noticed that factor structures get recoded when the data is dumped
using either dump or dput and then restored with source or dget. This
occurs when the values taken by factors do not include 1. For example:
a <-
2011 Nov 08
2
multi-line query
Hello,
I'm using package RpgSQL. Is there a better way to create a multi-line
query/character string? I'm looking for less to type and readability.
This is not very readable for large queries:
s <- 'create table r.BOD("id" int primary key,"name" varchar(12))'
I write a lot of code, so I'm looking to type less than this, but it is
more readable from
2007 Oct 24
3
scoping problem
I would like to write a function that computes Tukey's 1 df for
nonadditivity. Here is a simplified version of the function I'd like to
write: (m is an object created by lm):
tukey.test <- function(m) {
m1 <- update(m, ~.+I(predict(m)^2))
summary(m1)$coef
}
The t-test for the added variable is Tukey's test. This won't work:
data(BOD)
m1 <- lm(demand~Time,BOD)
1997 Dec 19
1
R-beta: a bug in the lm function ?
I ran a function called BoxCox, taken from the book by Venables and
Ripley, for checking the need for power transformation. This function
works fine using the version 0.50 of R, but gives an error message
with version 0.60.
The lm function in version 0.60 is different from that in version 0.50.
Is there a bug in the new lm function?
Kung-Sik Chan
>
2012 May 04
1
weird predict function error when I use naive bayes
Hi,
I tried to use naivebayes in package 'e1071'.
when I use following parameter, only one predictor, there is an error.
> m<- naiveBayes(iris[,1], iris[,5])
> table(predict(m, iris[,1]), iris[,5])
Error in log(sapply(attribs, function(v) { :
Non-numeric argument to mathematical function
However, when I use two predictors, there is not error any more.
> m<-
2012 May 05
1
what is Non-numeric argument to mathematical function in prediction ?
Hi,
I tried to use naivebayes in package 'e1071'.
when I use following parameter, only one predictor, there is an error.
> m <- naiveBayes(iris[,1], iris[,5])
> table(predict(m, iris[,1]), iris[,5])
Error in log(sapply(attribs, function(v) { :
Non-numeric argument to mathematical function
However, when I use two predictors, there is not error any more.
> m <-
2004 Aug 19
2
Suggestion for posting guide
I have a suggestion for the posting guide. One problem with some posts is that
they do not provide an example that can be reproduced. I think that many
people just do not know how to easily specify some data and some technical
assistance should be provided in the posting guide. If the problem
depends on specific data they should be made aware, in the posting guide, of:
dput(x)
since that
2007 May 31
1
predict.nls - gives error but only on some nls objects
Dear list,
I have encountered a problem with predict.nls (Windows XP, R.2.5.0), but I am not sure if it is a bug...
On the nls man page, an example is:
DNase1 <- subset(DNase, Run == 1)
fm2DNase1 <- nls(density ~ 1/(1 + exp((xmid - log(conc))/scal)),
data = DNase1,
start = list(xmid = 0, scal = 1))
alg = "plinear", trace =
2011 Dec 21
2
Using wdTable() within R2wd package
Hi All,
I am trying to use the wdTable() function within R2wd package to send a
dataframe to MS-word. However, there is a problem with the tables that are
generated by R. For some reason the header row of the table also contains
all the data. You can see it by dragging the bottom border of the table
down to make the row wider. For example, the data named 'bod' should look
like as:
2008 Jun 19
1
PrettyR (describe)
#is there a way to get NA in the table of descriptive statistics instead of
the function stopping Thank you in advance
#data
x.f <- structure(list(Site = structure(c(9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L), .Label = c("BC", "HC", "RM119", "RM148", "RM179",
"RM185",
2001 Aug 15
1
Password change request
Are there any plans to support the SSH_MSG_USERAUTH_CHANGEREQ message (part
of ssh v2 authentication protocol). We have an SSH server for RTOSs that is
able to send that message. So we're interested in support in the ssh client.
Roger Bod?n
INTERPEAK
Box 7498
SE-103 92 Stockholm
Sweden
Office: +46 8 545 275 80
Fax: +46 8 545 275 99
www.interpeak.com