Displaying 20 results from an estimated 2000 matches similar to: "Plot: Distance between tick and tick label on y-axis"
2005 May 26
1
Useful tip: Use Google to find R scripts
Hello,
Ever wondered how people use a particular function in their programs? Use
Google to find actual scripts:
filetype:R boxplot
will return real R scripts using the boxplot function.
Regards,
Pierre Lapointe
Assistant Market Strategist
***********************************************************************************
AVIS DE NON-RESPONSABILITE:\ Ce document transmis par
2005 Jun 08
1
RODBC question: problem importing series with blank cells
Hello,
I have an excel file that I load through RODBC. Some of my columns are
blank. They are equity time series and the stocks did not exist at the
earlier dates. My problem is that the whole column becomes <NA> even though
there are numbers at later dates.
Here's my excel file
http://www.tradebit.com/download.php/35699
<http://www.tradebit.com/download.php/35699>
And
2005 May 12
2
Batch mode problem: figure margins too large (code corrected for word wrap)
First of all, I apologize for the triple post, but I did not see that the
word wrap on the r-help list site would render my code unusable. So here it
is again. Hoping that this time it will work if you cut and paste it in
your Rgui.
I have a program that works well in Rgui but that does not work in a batch
file (Execution halted).
Here's the code (it will work on your R, but you need
2005 May 19
5
Arranging Plots
Dear all,
I'd appreciate any hints how to arrange some plots.
I have three plots. I would like to arrange them in the following order:
- Plot 1 and Plot 2 should be in the upper row
- Plot 3 should be in the lower row but centered in the middle.
I hope the following sketch will help understanding my problem
================
| === === |
|| P1| |P2 | |
|| | | | |
| === === |
2005 May 22
4
Calling R from R and specifying "wait until script is finished"
Hello,
Let's say I have 50 R scripts to run. What would be the most efficient way
to run them?
I thought I could do multiple Rterms in a DOS batch file:
Ex:
Rterm <1.R> 1.txt
Rterm <2.R> 2.txt
...
Rterm <50.R> 50.txt
However, I'm afraid they will all open at the same time. I know I could
pause the batch file with something like:
PING 1.1.1.1 -n 1 -w 60000
2005 Jun 14
1
Matrix stability problem
Hello,
This is not a problem with R, the calculated results are mathematically
correct. This a matrix stability problem. Because of measuring errors, my
matrix solution is a bit off.
Here is what my equations look like:
A11 x11+A12 x12 +A13 x13 = b1
A21 x21+A22 x21 +A23 x23 = b2
A31 x31+A32 x31 +A33 x33 = b3
A is a reading, X is a measured weight, and b is total. The 3 experiments
give
2006 Apr 05
2
gsub in data frame
Hello,
I have this data frame:
### begin
d <-data.frame(matrix(c("1","--","bla",2),2,2))
d
# I want to replace the "--" by "\N" and still get a data frame.
# I tried:
out <-gsub("--","\\\\N",as.matrix(d)) #using as.matrix to get rid of factors
out
cat(out)
# But I lost my data frame
### end
Any idea?
Regards,
2005 May 13
1
Lowest data level since DateX
Hello,
I'm dealing with financial time series. I'm trying to find out X in this
sentence:
The most recent close is the lowest level since X(date).
Here's an example of what I'm looking for:
library(fBasics)
data(DowJones30)
tail(DowJones30[,1:5],n=10)
I need to come up with a vector that would look like this
AA AXP T ...
2000-12-21
2006 Apr 24
2
Change the language of the labels in a graph
Hello,
How do you change the language of the labels in a graph. In this example, I
want to get French labels by changing Sys.putenv. I should get "Mai"
instead of "May".
Sys.putenv(LANGUAGE="fr")
x <- as.Date(c("1jan1960", "2jan1960", "31mar1960", "30jul1960"), "%d%b%Y")
y <-1:4
plot(x,y)
Regards,
Pierre
2006 Jul 19
1
How would you export a 3-dimensional array to an SQL database?
Hello,
How would you export a 3-dimensional array to an SQL database?
a<-array(1:24, 2:4)
Is there an open source DB that would be more adequate for this type of
operation?
Is there a way to reshape/flatten a 3-dimensional array?
Regards,
Pierre Lapointe
**************************************************
AVIS DE NON-RESPONSABILITE: Ce document transmis par courrie...{{dropped}}
2005 May 18
2
Why can't I download "window binary" zip packages
Hello there,
I tried so many times to download windows binary zip package but it told
me that I don't have the access to do so. It worked for me a few months
ago. Please help me with it.
Thank you
Lisa Wang Msc.
Princess Margaret Hospital
Toronto , Canada
tel: (416) 946 4501 ext.5201
2006 Jun 09
3
sqlSave() and rownames=TRUE makes my Rgui crash
Hello,
I created a table in MySQL with this command
CREATE TABLE example (pk INT NOT NULL AUTO_INCREMENT,PRIMARY KEY(pk),
id VARCHAR(30),col1 VARCHAR(30),col2 VARCHAR(30))
### In R, I can connect to this table:
library(DBI)
library(RODBC)
chan <- odbcConnect("MySQL51", uid="root", pwd="xxx")
first <- sqlQuery(chan, "select * from example")
2005 May 12
0
Batch mode problem: figure margins too large
Hello, I have a program that works well in Rgui but that does not work in a
batch file (Execution halted)
Here's the code (it will work on you side, but you need internet access
through R as it will download a table from a US gov site)
download.file("http://www.cftc.gov/files/dea/history/deacot2005.zip",
"c:/deacot2005.zip",
"internal", quiet = FALSE, mode =
2005 May 12
0
RE: Batch mode problem: figure margins too large (aligned R code to the left)
> Hello, I have a program that works well in Rgui but that does not work in
> a batch file (Execution halted)
>
> Here's the code (it will work on you side, but you need internet access
> through R as it will download a table from a US gov site)
>
> download.file("http://www.cftc.gov/files/dea/history/deacot2005.zip",
> "c:/deacot2005.zip",
>
2005 May 16
0
Turnpoints (pastecs): How to specify a limit on the number of tur npoints?
Hello,
I'm trying to get a few turnpoints for a financial time series. There is a
function in pastecs that does that. However, I get a large number of
turnpoints:
library(pastecs)
data(EuStockMarkets)
dax <-EuStockMarkets[,1]
plot(dax)
turnp <-turnpoints(dax)
summary(turnp) #gives 925 peaks/pits!!!
How can specify to get only 30 turnpoints?
Second question: the extract function
2006 Nov 06
2
grep searching for sequence of 3 consecutive upper case letters
Hello,
I need to identify all elements which have a sequence of 3 consecutive upper
case letters, anywhere in the string.
I tested my grep expression on this site: http://regexlib.com/RETester.aspx
But when I try it in R, it does not filter anything.
str <-c("AGH", "this WOUld be good", "Not Good at All")
str[grep('[A-Z]{3}',str)] #looking for a
2006 Nov 07
1
Gregexpr - extract results with lapply
Gregexpr - extract results with lapply
Hello,
I need to extract sequences of three upper case letters in a string. In
other words, in this string:
str <-c("ABC", "this WOUld be gOOD")
The result I'm looking for is ABC WOU OOD.
With gregexpr, I can get the position and length of the sequences
gregexpr('[A-Z]{3}',str,perl=TRUE)
[[1]]
[1] 1
2007 Jan 16
1
system(mysql... Does not recognize < as passing an attribute (No HTML)
Hi,
This is my command line request: mysql -u root -ppassword -D quant
<c:/cline.txt
This line works from the command line in windows.
In R, when I try to use the system function, it does not work,
> system(paste('mysql -u root -ppassword -D quant
<c:/cline.txt'),show.output.on.console = TRUE)
ERROR 1102 (42000): Incorrect database name '<c:/cline.txt'
It seems
2006 Mar 14
2
Multi-line paste function
Here's my contribution to R.
When R interacts with external programs (MySQL, cURL, etc.), it often
requires a pasted string that is sent to these programs. For readability
reasons, it is often preferable to have complex commands (SQL for example)
spread on several lines. However, the normal paste function requires to add
additional ' ", ' at the end of each line and another '
2005 Jan 31
2
how to move x-axis labels down
Hi,
In the code below, the labels I put on the x-axis are too high (they cross the
axis). Can anyone tell me how to move them down? I've tried adj=, padj=, mar=,
and various other things, but cannot move them down.
Thanks.
-Ben
labs <- paste('sample', 1:10)
plot(1:10, xaxt='n', xlab='')
axis(1, at=1:10, labels=labs, padj=1, las=2) # las is a par() parameter