G'day H.T.
On Sat, 1 Jan 2011 00:41:10 -0500 (EST)
"H. T. Reynolds" wrote:
> When I create a factor with labels in the order I want, write the
> data as a text file, and then retrieve them, the factor levels are no
> longer in the proper order.
Not surprisingly. :)
[..big snip..]
> testdf <-
Hello (and Happy New Year),
When I create a factor with labels in the order I want, write the data as a
text file, and then retrieve them, the factor levels are no longer in the
proper order.
Here is what I do (I tried many variations):
# educ is a numeric vector with 1,001 observations.
# The
Hello,
thank you all. I have been able to solve my problem with your help.
The problem I am trying to solve is:
I am working on a clustering method to group a data base. At the moment I am
using the clustering hierarchical method and trying to get to the best K
group value via the silhouette fu
Duncan Murdoch gmail.com> writes:
> As others have said, there are packages that provide caching.
>
> I haven't used them, because I like to keep my projects as
> self-contained as possible: adding a dependency on one of those
> packages is undesirable[1]. What I do in the case where there a
You don't give us much to go on, but some variant of
country <- c("US", "France", "UK", "NewZealand", "Germany", "Austria", "Italy",
"Canada")
result <- read.csv("result.csv", header = FALSE)
names(result) <- country
should do what you want.
From: r-hel
On 12/30/2010 02:30 PM, Paul Rigor wrote:
> Thanks gang,
> I'll work with named vectors and concatenate as needed.
This might be ok for small problems, but concatenation is an inefficient
R pattern -- the objects being concatenated are copied in full, so
becomes longer, and the concatenation slowe
On 31/12/2010 3:35 PM, Lars Bishop wrote:
Hi,
Maybe I'm missing the point here...but let's suppose you are working with
"large" data sets and using functions that take a significant amount of time
to run in R. I woulnd't like to run these functions every time I call
Sweave("myfile.Rnw") within R
I still recommend the pgfSweave package (as usual) -- you can cache
both data objects (using cacheSweave) and graphics (using pgf).
Regards,
Yihui
--
Yihui Xie
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Fri, Dec 31
My very simple approach is to check if the output file exists (within the
Sweave file), and run the time-consuming bits only if it does not.
As Uwe says, there are more sophisticated approaches too.
Sarah
On Fri, Dec 31, 2010 at 3:35 PM, Lars Bishop wrote:
> Hi,
>
> Maybe I'm missing the point
On 31.12.2010 11:02, Paolo Rossi wrote:
I am trying to use sos but I get the message below
My PC's spec is: MS XP Version 2002 SP 3
Intel Celeron E3300 @ 2.50Ghz
Is the error below related to a firewall or something?
Are you able to connect to that side via your favorite internet browser?
Google for "cache" and "Sweave" and you will find more than one package
that extend Sweave and provide kinds of caching, i.e. roughly what you
have in mind anyway.
Best,
Uwe Ligges
On 31.12.2010 21:35, Lars Bishop wrote:
Hi,
Maybe I'm missing the point here...but let's suppose you are work
Hi,
Maybe I'm missing the point here...but let's suppose you are working with
"large" data sets and using functions that take a significant amount of time
to run in R. I woulnd't like to run these functions every time I call
Sweave("myfile.Rnw") within R. What is the "common" practice to use Sweav
On Dec 31, 2010, at 2:49 AM, Jukka Koskela wrote:
Hello,
Could somebody please tell me what am I doing wrong in following?
I try extract coefficients (using arm-package) from the lmer
frunction, but I get the
following warning:
a<-data.frame(coef(res))
Error in as.data.frame.default(x[[i]]
On Fri, 31 Dec 2010, Paolo Rossi wrote:
Hi Everyone,
quick question before the end of the year.
I have soem indices to select data from a bigger sample. I want to select n
days before each index and n days after the index. Any clever way to do it.
For heavy duty applications involving interv
On Fri, Dec 31, 2010 at 1:03 PM, Paolo Rossi
wrote:
> Hi Everyone,
>
> quick question before the end of the year.
>
> I have soem indices to select data from a bigger sample. I want to select n
> days before each index and n days after the index. Any clever way to do it.
> A for loop would do but
On 31/12/2010 1:03 PM, Paolo Rossi wrote:
Hi Everyone,
quick question before the end of the year.
I have soem indices to select data from a bigger sample. I want to select n
days before each index and n days after the index. Any clever way to do it.
A for loop would do but I wanted to know if t
Marc/Gabor
many thanks for your responses which have helped me to proceed.
Sometimes doing your homework before asking can appear quite obvious but
to newbies it is also quite difficult to get the correct question;
therefore I appreciate your valued responses.
Happy New Year to you all
Bob
O
in my pevious message the line with SampleWidth should be SampleWidth = 5
Paolo
On 31 December 2010 18:03, Paolo Rossi wrote:
> Hi Everyone,
>
> quick question before the end of the year.
>
> I have soem indices to select data from a bigger sample. I want to select n
> days before each index and
Hi Everyone,
quick question before the end of the year.
I have soem indices to select data from a bigger sample. I want to select n
days before each index and n days after the index. Any clever way to do it.
A for loop would do but I wanted to know if there is a moreR-friendly way to
approach thi
Thanks Berend, setting lower=c(0,0.01) seems to have solved the problem. I
have a dataset with 200+ cropped fields with associated data and wanted to
generate each plot in a way that minimized the visual residuals between the
green squares and blue circles. I have inserted a resulting plot so yo
Is this what you want:
> library(cluster)
> d<-hclust(dist(iris[,-5]))
>
> avgs<-sapply(1:20,function(x)
+ summary(silhouette(cutree(d,x),
+
+ dist(iris[,-5]
> # str(avgs)
>
> # print out the average widths
> for (i in 2:length(avgs)){ # ignore first item
+ cat('i=', i, 'average=', avgs[[
On Dec 31, 2010, at 10:34 AM, ADias wrote:
ADias wrote:
Hi,
I am using the code below to get a plot that will show me on the X
axis
the number of clusters and on the Y axis the cluster average widths.
However I am getting this error:
Error in summary(silhouette(cutree(d, x), dist(iris[
Follow up:
The critical line seems to be in survexp around line 97
rdata <- data.frame(eval(rcall, m))
If changed to:
old.stringsAsFactors <- options()$stringsAsFactors
options(stringsAsFactors=TRUE)
rdata <- data.frame(eval(rcall, m)) ### <- seems to be critical
options(stringsAsFactors=old.
On Fri, Dec 31, 2010 at 05:05:08AM -0800, Sarah wrote:
>
> I'm sorry, I don't think I've made myself clear enough.
>
> Cases have been randomly assigned to one of the two groups, with certain
> probabilities (based on other variables).
> So, if there are too many people (i.e., more than 34) assig
ADias wrote:
>
> Hi,
>
> I am using the code below to get a plot that will show me on the X axis
> the number of clusters and on the Y axis the cluster average widths.
> However I am getting this error:
>
> Error in summary(silhouette(cutree(d, x), dist(iris[, -5])))$si.summary :
> $ operat
Try:
df1 = read.csv('result.csv', header=TRUE)
df1
Jason
On 12/31/2010 03:19 AM, Amy Milano wrote:
Please read - http://127.0.0.1:24408/library/base/html/colnames.html
I am trying to give an example. I am not a programmer and I am sure the R
stalwarts will have better ways to do it.
# Supp
Dear R-users,
I am working with a colleague on extracting and processing data from our
Oracle database using R scripts. We performed some initial testing using
functions available in the ROracle package. Overall, our tests were
successful and encouraging. There are however a couple of questions/pr
Dear Peter, Dear All,
a further attempt led me to an answer. If I set
options(stringsAsFactors=TRUE), which I usually have set to FALSE, no
error occurs.
I am, however not happy with this solution.
Heinz
Thank you, Peter
after setting options(error=recover), see the output below, once for
Thank you, Peter
after setting options(error=recover), see the output below, once for
frame number 2, which I suspect to be the problem, once for frame number 1.
Heinz
> expect <-
+ survexp(futime ~ ratetable(age=(accept.dt - birth.dt),
+ sex=1,year=accept.dt,ra
On Dec 31, 2010, at 8:32 AM, David Winsemius wrote:
On Dec 31, 2010, at 8:05 AM, Sarah wrote:
I'm sorry, I don't think I've made myself clear enough.
Cases have been randomly assigned to one of the two groups, with
certain
probabilities (based on other variables).
So, if there are too m
On Dec 31, 2010, at 8:05 AM, Sarah wrote:
I'm sorry, I don't think I've made myself clear enough.
Cases have been randomly assigned to one of the two groups, with
certain
probabilities (based on other variables).
So, if there are too many people (i.e., more than 34) assigned to
group 0,
I'm sorry, I don't think I've made myself clear enough.
Cases have been randomly assigned to one of the two groups, with certain
probabilities (based on other variables).
So, if there are too many people (i.e., more than 34) assigned to group 0, I
would like to sample 34 cases from group 0, and g
On Dec 31, 2010, at 10:21 , Heinz Tuechler wrote:
> Dear All,
>
> reposting, because I did not find a solution, maybe someone could check the
> example below.
>
> It's taken from the help page of survdiff. Executing it, gives the error
>
> "Error in floor(temp) : Non-numeric argument to mathe
The error occurs in the x <- solve(A,RHS) statement.
In a certain iteration ylim_2 passed by optim to your function is c(0,0)
That give a zero column of matrix A ==> exactly singular.
If I set lower=c(0,0.01) in the call of optim and use the na.approx then the
result is
ylim_2=c(0, 4.63) with th
On Fri, Dec 31, 2010 at 01:51:18AM -0800, Sarah wrote:
>
> Dear all,
>
> I'm having trouble with my dataframe, and I hope someone can help me out...
> I have data from 40 subjects, displayed in a dataframe. I have randomly
> assigned subjects to group 1 or 0 (mar.y==0 or mar.y==1, with probabilit
On 12/31/2010 08:51 PM, Sarah wrote:
Dear all,
I'm having trouble with my dataframe, and I hope someone can help me out...
I have data from 40 subjects, displayed in a dataframe. I have randomly
assigned subjects to group 1 or 0 (mar.y==0 or mar.y==1, with probabilities
used).
In the end, I wan
I am trying to use sos but I get the message below
My PC's spec is: MS XP Version 2002 SP 3
Intel Celeron E3300 @ 2.50Ghz
Is the error below related to a firewall or something?
Thanks and Happy New Year
Paolo
Error in readLines(link) : cannot open the connection
In addition: Warning message:
Dear all,
I'm having trouble with my dataframe, and I hope someone can help me out...
I have data from 40 subjects, displayed in a dataframe. I have randomly
assigned subjects to group 1 or 0 (mar.y==0 or mar.y==1, with probabilities
used).
In the end, I want 34 cases assigned to group 0, with th
Dear All,
reposting, because I did not find a solution, maybe someone could
check the example below.
It's taken from the help page of survdiff. Executing it, gives the error
"Error in floor(temp) : Non-numeric argument to mathematical function"
best regards,
Heinz
library(survival)
## Exa
Please read - http://127.0.0.1:24408/library/base/html/colnames.html
I am trying to give an example. I am not a programmer and I am sure the R
stalwarts will have better ways to do it.
# Suppose
df1 = read.csv('result.csv')
where (say e.g.) result.csv is as follows
result.csv
var1 var
On Thu, Dec 30, 2010 at 11:01:47PM -0800, Sintayehu Aynalem wrote:
> I nanna subscribe to r-help.
>
> Can you please guide me...
Start at
http://www.r-project.org/
Click on "Mailing lists".
Find section "R-help".
Click on "web interface".
Find section "Subscribing to R-help" and follow the desc
41 matches
Mail list logo