Displaying 17 results from an estimated 17 matches for "shvorob".
2010 Aug 26
5
Quick GREP challenge
> grep("f[0-9]+=", "f1=5,f22=3,", value = T)
[1] "f1=5,f22=3,"
How do I make the line output c("f1", "f22") instead? (Actually, c(1,22)
would be even better).
Thank you.
--
View this message in context: http://r.789695.n4.nabble.com/Quick-GREP-challenge-tp2339486p2339486.html
Sent from the R help mailing list archive at Nabble.com.
2010 Sep 06
3
Failure to aggregate
I have a (very big - 1.5 rows) dataframe with a (POSIXt" "POSIXlt") column h
(hour). Surprisingly, I cannot calculate a simple aggregate over the
dataframe.
> n.h1 = sqldf("select distinct h, count(*) from x group by h")
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: no such table: x)
In addition: Warning message:
In
2010 Jan 24
3
Is there a quicker way to drop a data frame column than setting it to NULL?
If I want to drop columns x, y, z from dataframe df, is there a better
alternative to
df$x = NULL
df$y = NULL
df$z = NULL
There are sufficiently many columns remaining to make
df = subset(df, select = c(a,b,c,d[etc]))
cumbersome.
Thank you.
--
View this message in context: http://n4.nabble.com/Is-there-a-quicker-way-to-drop-a-data-frame-column-than-setting-it-to-NULL-tp1288617p1288617.html
2010 Jan 23
3
How to implement a "select distinct x, count(distinct y) ... group by x" for a data frame
... Being an R newbie, I can only think of extracting distinct x values with
unique, looping over them, extracting matching rows from the original data
frame, applying table, and recording the size of table's output alongside
the x value being checked. Is there a more elegant way?
Thank you.
--
View this message in context:
2007 Oct 21
6
exporting text output to pdf
Hello,
I am new to R and I am trying to figure out how to print text output from an operation like table() to a pdf file. Is there a simple command to do this, or do you need to work with connections at a rudimentary level?
Thanks you,
Jesse
[[alternative HTML version deleted]]
2010 Feb 14
4
Newbie woes with *apply
Dataframe cust has Date-type column open.date. I wish to set up another
column, with (first day of) the quarter of open.date.
To be comprehensive (of course, improvement suggestions are welcome),
month = function(date)
{
return(as.numeric(format(date,"%m")))
}
first.day.of.month = function(date)
{
return(date + 1 - as.numeric(format(date,"%d")))
}
first.day.of.quarter =
2010 Jan 30
2
Applying a transformation to multiple data frame columns
How can one simplify the folowing?
t$aum[is.na(t$aum)] = 0; t$aum.core[is.na(t$aum.core)] = 0
t$num[is.na(t$num)] = 0; t$num.core[is.na(t$num.core)] = 0
Thank you.
--
View this message in context: http://n4.nabble.com/Applying-a-transformation-to-multiple-data-frame-columns-tp1457641p1457641.html
Sent from the R help mailing list archive at Nabble.com.
2010 Apr 28
2
How to read contents of a text file into a single string?
... Both readLines() and scan() produce a number_of_lines x 1 vector; trying
paste(s, collapse = NULL) leaves it unaffected. How can I concatenate vector
elements (lines) into a single string?
Thank you.
--
View this message in context: http://r.789695.n4.nabble.com/How-to-read-contents-of-a-text-file-into-a-single-string-tp2069303p2069303.html
Sent from the R help mailing list archive at
2010 Feb 02
1
[R] Suppressing scientific notation on plot axis tick labels (PR#14202)
On 02/02/2010 6:20 AM, Dimitri Shvorob wrote:
> Ruben Roa has kindly suggested using 'scipen' option - cf.
>
>> fixed notation will be preferred unless it is more than ???scipen??? digits
>> wider.
>
> However,
>
> options(scipen = 50)
> x = c(1e7, 2e7)
> barplot(x)
>
> still does...
2010 Feb 14
2
Problems with boxplot in ggplot2:qplot
Dataframe closed contains balances of closed accounts: each row has month of
closure (Date-type column month) and latest balance. I would like to plot
by-month distributions of balances. A qplot call below produces several
warnings and no output.
Can anyone help?
Thank you.
PS. A really basic task, very similar to the examples on p. 71 of the
ggplot2 book, apart from a Date grouping column; I
2010 Dec 27
1
Can't merge on datetime?
x = structure(list(date = structure(list(sec = c(0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), min = c(0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L), hour = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), mday = c(1L, 2L,
3L, 4L, 5L, 8L, 9L, 10L, 11L, 12L, 15L, 16L, 17L, 18L, 19L, 22L,
23L, 24L,
2010 Feb 21
2
Newbie woes with par:mar
I have a simple barchart with horizontal bars and horizontal tick labels,
produced with
barplot(x, horiz = T, names.arg = c, las = 1)
The labels are longish strings, truncated on the plot. I wish to leave more
space for the left margin, and experiment with mar parameter,
barplot(x, horiz = T, names.arg = c, las = 1, mar = c(5, 15, 4, 2))
trying various values for the second vector element, but
2010 Dec 25
1
Extracting a dataframe column as a dataframe
> x = structure(list(time = structure(c(1020232904.818, 1020232904.818
), class = c("POSIXt", "POSIXct"), tzone = ""), price = c(321,
323.5)), .Names = c("time", "price"), row.names = 1:2, class = "data.frame")
> x1 = x[,c("price")]
> dput(x1)
c(321, 323.5)
Is there similar syntax that gets "price" as a
2010 Feb 02
0
[R] Suppressing scientific notation on plot axis tick labels (PR#14203)
murdoch at stats.uwo.ca wrote:
> On 02/02/2010 6:20 AM, Dimitri Shvorob wrote:
>> Ruben Roa has kindly suggested using 'scipen' option - cf.
>>
>>> fixed notation will be preferred unless it is more than =C3=A2=E2=82=AC=
=CB=9Cscipen=C3=A2=E2=82=AC=E2=84=A2 digits
>>> wider.
>> However,=20
>>
>> options(scipen =3D...
2010 Nov 24
0
4. Rexcel (Luis Felipe Parra)-how to run a code from excel
...le density in rgl
(Mike Marchywka)
50. Re: data acquisition with R? (B.-Markus Schuller)
51. Is it possible to make a matrix to start at row 0? (bogdanno)
52. Re: Rexcel (csrabak)
53. Re: question about constraint minimization (dhacademic at gmail.com)
54. Re: Lost in POSIX (Dimitri Shvorob)
55. Re: Find in R and R books (Georg Otto)
56. Re: using rpart with a tree misclassification condition (meytar)
57. Re: memory profiling (Patrick Leyshock)
58. Some questione about plot (romzero)
59. how do remove those predictor which have p value greater than
0.05 in GLM? (shubha...
2010 Feb 02
2
Suppressing scientific notation on plot axis tick labels
Is there a better alternative to
x = c(1e7, 2e7)
x.lb = c(0,1e7,2e7)
s.lb = format(x.lb, scientific = FALSE, big.mark = ",")
barplot(x, yaxt = "n", ylab = "")
axis(side = 2, at = x.lb, labels = s.lb)
(I am sure there is a better alternative to line 2 :)).
Thank you.
--
View this message in context:
2011 Apr 27
1
bwlpot problems: printing, and tick labels
Two problems with the code below.
A. It produces empty JPEGs. When the 'bwplot' line alone is submitted, the
plot duly shows up.
B. When the 'bwplot' line alone is submitted, y labels are values 1 to 6,
not actual distinct values of y$maxthreads.
(C. I would, of course, prefer to produce plots for all distinct values of
x$maxthreads in a single swoop, on a single figure).
Can