Displaying 20 results from an estimated 4000 matches similar to: "context of runif()"
2016 Feb 19
2
should `data` respect default.stringsAsFactors()?
Aha... Hadn't noticed that stringsAsFactors only works via as.is in read.table.
Yes, the doc should probably be fixed. The code probably not -- packages loading different data sets depending on user options is an even worse idea than hav?ng the option in the first place... (I don't mean having the possibility, I mean the default.stringsAsFactor thing).
In general, read.table() gets
2016 Feb 19
4
should `data` respect default.stringsAsFactors()?
Hi Peter,
Sorry if I was not clear. Perhaps an example will make my point:
> data(iris)
> class(iris$Species)
[1] "factor"
> write.table(iris,'data/myiris.tab')
> data(myiris)
> class(myiris$Species)
[1] "factor"
> rm(myiris)
> options(stringsAsFactors = FALSE)
> data(myiris)
> class(myiris$Species)
[1] "factor"
>
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
2017 Aug 23
1
cross validation in random forest using rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package
2017 Aug 23
2
cross validation in random forest rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package
2003 Nov 05
1
save(iris,file="clipboard",ascii=TRUE)
Is this a bug? I thought that "clipboard" could always be substituted
for a filename when dealing with ASCII files.
> data(iris)
> save(iris,ascii=TRUE,file="clipboard")
Error in file(file, "wb") : `mode' for the clipboard must be `r' or `w'
Also this (where gclip is a utility found at unxutils.sourceforge.net
that copies its standard input to the
2017 Aug 23
0
cross validation in random forest using rfcv functin
Any responds?!
On Wednesday, August 23, 2017 5:50 AM, Elahe chalabi via R-help <r-help at r-project.org> wrote:
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I
2013 Mar 02
2
caret pls model statistics
Greetings,
I have been exploring the use of the caret package to conduct some plsda
modeling. Previously, I have come across methods that result in a R2 and
Q2 for the model. Using the 'iris' data set, I wanted to see if I could
accomplish this with the caret package. I use the following code:
library(caret)
data(iris)
#needed to convert to numeric in order to do regression
#I
2016 Feb 19
0
should `data` respect default.stringsAsFactors()?
On Thu, Feb 18, 2016 at 6:03 PM, Cook, Malcolm <MEC at stowers.org> wrote:
> Hi Peter,
>
> Sorry if I was not clear. Perhaps an example will make my point:
>
>> data(iris)
>> class(iris$Species)
> [1] "factor"
>> write.table(iris,'data/myiris.tab')
>> data(myiris)
>> class(myiris$Species)
> [1] "factor"
>>
2016 Feb 19
0
should `data` respect default.stringsAsFactors()?
Hi,
> Aha... Hadn't noticed that stringsAsFactors only works via as.is in read.table.
>
> Yes, the doc should probably be fixed. The code probably not
Agreed.
Is someone on-list authorized and willing to make the documentation change? I suppose I could learn what it takes to be a "player", but for such a trivial fix, it probably is overkill. Dissenting opinions?
2012 May 25
3
count number of groups
Hello,
Simple question that I am stuck on and can't seem to find an answer in the
help files currently. I have a list which contains repeated ID's. I would
like to have R count the number of ID's. For example:
ID=c(1,1,1,1,2,2,2,2,3,3,3,3)
as.data.frame(ID)
Clearly, there are 3 groups. How would I have R give me the summary:
ID
3
Many thanks,
Charles
[[alternative HTML
2012 Oct 26
4
Merge matrices with different column names
A general question that I have been pursuing for some time but have set
aside. When finishing some analysis, I can have multiple matrices that
have specific column names. Ideally, I would like to combine these
separate matrices for a final output as a csv file.
A generic example:
Matrix 1
var1A var1B var1C
x x x
x x
2012 Dec 04
3
reformatting some data
Hello,
I am trying to reformat some data so that it is organized by group in the
columns. The data currently looks like this:
group X3.Hydroxybutyrate X3.Hydroxyisovalerate ADP
347 4 4e-04 3e-04 5e-04
353 3 5e-04 3e-04 6e-04
359 4 4e-04 3e-04
2012 Sep 28
3
Better way of Grouping?
Hello R users,
This is more of a convenience question that I hope others might find useful
if there is a better answer. I work with large datasets that requires
multiple parsing stages for different analysis. For example, compare group
3 vs. group 4. A more complicated comparison would be time B in group 3 of
group L with B in group 4 of group L. I normally subset each group with
the
2016 Feb 18
2
should `data` respect default.stringsAsFactors()?
Hiya,
Probably been debated elsewhere....
I note that R's `data` function does not respect default.stringsAsFactors
By my lights, it should, especially as it is documented to call read.table, which DOES respect.
Oh, but: http://r.789695.n4.nabble.com/stringsAsFactors-FALSE-tp921891p921893.html
Compelling. I have to agree.
So, I change my mind.
By my lights, `data` should then be
2013 Mar 07
2
Multivariate Power Test?
Generic question... I am familiar with generic power calculations in R,
however a lot of the data I primarily work with is multivariate. Is there
any package/function that you would recommend to conduct such power
analysis? Any recommendations would be appreciated.
Thank you for your time,
Charles
[[alternative HTML version deleted]]
2012 Oct 17
2
cut2 error
To R users,
I am trying to use cut2 function from the 'Hmisc' library. However, when I
try and run the function on the following variable, I get an error message
(displayed below). I suspect it is because of the NA but I have no idea
how to address the error. Many thanks to any insights.
structure(list(var1 = c(97, 97, 98, 98, 97, 99, 97,
98, 99, 98, 99, 98, 98, 97, 97, 98, 99, 98,
2013 Oct 02
5
Interpreting the result of a Wilcoxon (Mann-Whitney U) test
Hello everyone,
I'm having some trouble interpreting the results of a Wilcoxon
(Mann-Whitney U) test. Hope you can help.
This is the R script that I am running:
a <- c(1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 5, 1, 1, 1, 3, 1, 1,
1, 1, 1, 1, 3, 1, 1)
b <- c(1, 2, 1, 1, 2, 3, 2, 2, 1, 2, 1, 1, 1, 2)
wilcox.test(a, b, alternative="t", mu=0, exact=FALSE, paired=FALSE) #1st
2013 Jan 07
3
renumber a list of numbers
Greetings R users,
I am trying to renumber my groups within the file shown below. The groups
are currently set as 8,9,10,etc. I would like to renumber this as
1,2,3,etc. I have searched the help files and only come across using the
rownames to renumber the values but I need to match values. Any assistance
is always appreciated,
Regards,
Charles
structure(list(Group = structure(c(1L, 1L, 1L,
2012 Apr 20
1
Numbers not numeric?
Greetings R users,
I have a curious problem. I read in a csv file (subset shown below) as
normal
data=read.table("C:/Users/Chaz/Desktop/test.csv",sep=",",header=TRUE,
na.strings=".")
However, the numbers from the dataset are not registered as numeric:
is.numeric(data$Mesh)
[1] FALSE
When I try as.numeric, it converts all the values to different integers.
This