Displaying 8 results from an estimated 8 matches for "yschen".
Did you mean:
cschen
2006 Apr 27
2
add city and point in the map
Dear Helpers:
I'm trying to use packages "maps" and "mapdata" (see blow) to display the research resutls on map (Mid-Atlantic region). In particular, I need to mark a number of points in the map by giving their latitude and longitude information. For instance, I would like to mark a point on (long, lat) =(75.56027, 39.09271). Also, I need to mark several cities that I
2006 May 16
0
solution of split data.frame
...quot;, na="",
quote=FALSE, row.names = FALSE, col.names=FALSE)
system("{ cut -f1,2,3 foo.txt ; cut -f1,2,4 foo.txt ; } > bar.txt")
newDF <- read.table("bar.txt", col.names=c("V1","V2","x"))
newDF[1:10,]
On 5/15/06, YIHSU CHEN <yschen at jhu.edu> wrote:
> Dear R folks:
>
> I wonder anyone has a elegent way of doing what I need to do.
>
> I have a data frame called with four columns: V1, V2, A1 and A2:
>
> V1 V2 A1 A2
> A B 1.2 2.0
> A D 1.2 4.0
> A C 2.4 2.2
>
> Wha...
2006 May 18
1
How to write output in a specific formate with irregular space
Dear R users:
My question is how to write output in a specific formate with irregular
spacing?
Say that I have the following DF with three columns (A-C):
A B C
a10 100.0 212
The objective is to write an output file such that column A occupies
1-10 spaces aligned to the left, column B occupies 11-15 spaces aligned
to the right, and finally column C takes 16-25 spaces
2006 Jul 11
1
problem of fixed-formated output using sprintf
Dear R users:
I'm trying to generate a output file with fixed format using function "sprintf" in R. However, the execution time in R is very long even the toy data (smaller size df) seems to work fine. The syntax that I used is as follows:
df.fmt <- sprintf("%2s%2s%2.4f", df$v1, df$v2, df$v3)
write.table(df.fmt, output.name,...)
The actual dataset is a df with the
2006 May 16
2
split the data.frame
Dear R folks:
I wonder anyone has a elegent way of doing what I need to do.
I have a data frame called with four columns: V1, V2, A1 and A2:
V1 V2 A1 A2
A B 1.2 2.0
A D 1.2 4.0
A C 2.4 2.2
What I need to do is to convert it into the following data frame with a new column x, where x is just the stacked up of A1 and A2 placed with respective V1 and V2 in the first two
2006 May 18
2
create a vector
Dear R users:
I have an elementary question: how to creat a vector of [A1, A2, A3...... A300]? I know c(1:300) would give 1, 2, 3, ...., 300 but not sure how to attch a A to each element.
Thank you
Yihsu Chen
The Johns Hopkins University
2004 Mar 10
3
How to use MLE-class?
Hi there,
I had successfully use "MLE" function to solve my problem. Is there
anyone knows how to get related information? i.e., value of likelihood
function, information matrix, and etc. I know MLE-class can do it but I
can not find any information tells me how to do it.
Thanks a billions,
Yihsu
[[alternative HTML version deleted]]
2006 May 19
1
Writing to a file with fixed precision
Dear R users;
A follow-up question regarding writing to a file with fixed precision:
Assuming for each column of x, I would like to have a different format, then I modify the code as:
x.fmt <- apply(x, 1, function(x) sprintf("%.14f %.10f %2.5f", x))
where three different formats are %.14f %.10f %2.5f.
The error message I got is "Error in sprintf(fmt, ...) : too few