[R] citation() command doesn't work in R.3.1.1

2014-08-06 Thread Sverre Stausland
> citation() Error: $ operator is invalid for atomic vectors In addition: Warning message: In packageDescription(pkg = package, lib.loc = dirname(dir)) : no package 'base' was found > sessionInfo() R version 3.1.1 (2014-07-10) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Nor

[R] Set system font in R package Cairo in Mac OS X

2013-11-10 Thread Sverre Stausland
.pdf file always has the Helvetica font. library(package = "Cairo") CairoPDF("test.pdf") plot.new() text(x=.5,y=.5,labels="\u0260",family="Times New Roman") dev.off() The outputs are attached. The Times New Roman font is exactly the same on both system

[R] Using Unicode inside R's expression() command

2013-11-09 Thread Sverre Stausland
I'm using 'expression()' in R plots in order to get italicized text. But it appears as if I cannot use Unicode symbols inside 'expression' outside of ASCII characters. Is there some way I can work around this? My goal is to get the 'fi' ligature in various labels in my R barplots (together with ital

Re: [R] Reorder in decreasing order

2012-07-22 Thread Sverre Stausland
A F B F F B A A A F F B A D A F B B F A A F C > B A > [39] E E D E E D D D D D E D D C E E E E D D C C E D C C E E C C C C C C > Levels: A B C D E F > A.K. > > > > > > > - Original Message - > From: Sverre Stausland > To: arun > Cc: R help &

Re: [R] Reorder in decreasing order

2012-07-22 Thread Sverre Stausland
F > -14.50 -15.33 -2.08 -4.916667 -3.50 -16.67 > #### > Levels: F B A D E C > ### > > A.K. > > > > - Original Message - > From: Sverre Stausland > To: r-help@r-project.org > Cc: > Sent: Sunday, July 2

[R] Reorder in decreasing order

2012-07-22 Thread Sverre Stausland
does, but order the levels according to a _decreasing_ order of the values? Sverre __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] Remove names and more from list with capture.output()

2011-11-15 Thread Sverre Stausland
Thanks David - this is pretty close to what I am looking for. However, the output of vec[2] now includes the row number [1] and quotations marks at the endpoints of the row. Is there an easy way to exclude those? Thanks Sverre On Tue, Nov 15, 2011 at 8:11 AM, David Winsemius wrote: > >

[R] Remove names and more from list with capture.output()

2011-11-14 Thread Sverre Stausland
FPr(>F)), and not the significance codes. That is, I want the text printed to my text file to be: 2 -1 18.512 8.481e-05 *** Is there a way to do this? Thanks Sverre __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] update() ignores object

2011-08-15 Thread Sverre Stausland
That works! Thanks. On Mon, Aug 15, 2011 at 5:09 PM, Bert Gunter wrote: > Sverre: > > As your reproducible example shows, the problem is that the string > "y1:y2" is not an acceptable term of the formula. One way round this > is simply convert the non-string part of the

[R] update() ignores object

2011-08-15 Thread Sverre Stausland
Hi all, I'm extracting the name of the term in a regression model that dropterm specifies as the least significant one, and I'm assigning this name to an object. However, when I use update(), it ignores this object. Is there a way I can make it not ignore it? A reproducible example is below: > lm

Re: [R] embedFonts() does not embed fonts?

2011-08-09 Thread Sverre Stausland
Some of you might see that there's a tiny mistake in the embedFonts() call. fontpaths = "C/Windows/Fonts" should of course be fontpaths = "C:/Windows/Fonts". I fixed this, but it didn't change the fact that the new .pdf does not have its fonts embedded. Sverre

[R] embedFonts() does not embed fonts?

2011-08-09 Thread Sverre Stausland
Dear helpers, I'm trying out the embedFonts() to embed fonts into my pdf files. However, when I inspect the new pdf with a program designed to look for embedded fonts, I see that the fonts have in fact not been embedded. Below are my calls. R version 2.13.1 (2011-07-08) Copyright (C) 2011 The R

[R] Extract rows from a matrix according to value in column

2011-08-02 Thread Sverre Stausland
/r-help/2011-August/285650.html (I assume it's best not to respond at the end of threads with a "thank you" only, to avoid cluttering people's inboxes?) best Sverre __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

[R] Extract names from vector according to their values

2011-08-02 Thread Sverre Stausland
ot; "recommended" "recommended" spatial splines statsstats4 survival "recommended""base""base""base" "recommended" tcltk tools utils &qu

Re: [R] gsub() with unicode and escape character

2011-07-17 Thread Sverre Stausland
1252 attached base packages: [1] stats graphics grDevices utils datasets methods base > Sys.getlocale() [1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.125

[R] gsub() with unicode and escape character

2011-07-16 Thread Sverre Stausland
quot;the character \", but gsub() doesn't: > data.frame(animals=c("dog","wolf","cat"))->my.data > gsub("d","\\",my.data$animals) [1] "og" "wolf" "cat" Thank you Sverre __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Export Unicode characters from R

2011-07-15 Thread Sverre Stausland
arToRaw(funny.g) > writeBin(rawstuff, "funny.g.txt") But the function charToRaw() only allows an object with a single character, and writeBin cannot be used to export data frames. Is there any solution along these lines when I have a data frame with Unicode characters? Best Sverre On Fri,

Re: [R] Export Unicode characters from R

2011-07-15 Thread Sverre Stausland
e() > function with the encoding set explicitly. I'm sorry, but I don't understand what it means "to use cat() on a connection opened using the file() function". Could you please clarify that? Thanks Sverre __ R-help@r-project.or

[R] Export Unicode characters from R

2011-07-14 Thread Sverre Stausland
SE, fileEncoding = "UTF-8") > read.table ("C:/~funny.g.txt", header = FALSE, encoding = "UTF-8") -> > input.funny.g > input.funny.g$V1 [1] Levels: Best Sverre __ R-help@r-project.org mailing list https://s

Re: [R] Extract only the values from a row

2011-07-11 Thread Sverre Stausland
Great - thanks for the explanation and for the solution using stringsAsFactors=FALSE in the data.frame function Sverre On Mon, Jul 11, 2011 at 3:57 PM, Sarah Goslee wrote: > Hi Sverre, > > On Mon, Jul 11, 2011 at 12:48 PM, Sverre Stausland > wrote: >> Dear helpers, >> &

[R] Extract only the values from a row

2011-07-11 Thread Sverre Stausland
values "a" and "k" without getting the row names and column names with them. I'm asking because I want to assign the character values from a row as the names of the columns of the data frame. Best Sverre __ R-help@r-projec

[R] Interpreting the coefficient of an interaction between continuous variables in a regression model

2011-03-03 Thread Sverre Stausland
creasing, does it significantly affect the dependent variable?". But what if the interaction between them is inverse - such that a decreasing value in "Income" paired with an increasing value in "Children" will significantly affect the dependent var

[R] Visualizing some data

2009-10-05 Thread sverre
Hi all, I have an easy data set. It has three columns: Subject, Condition, dprime. A small excerpt follows, in order to illustrate: Subject Condition dprime HY s 3.725846 CM s 2.877658 EH s 5 HY st 2.783553 CM st 2.633955 EH st