Re: [R] Problem in installing packages on linux machine...

2007-09-08 Thread tkobayas
Hi,

I am trying to install RSQLite package on my Fedora workstation. I 
tried to install other packages as well, but each time I got the same 
error messages saying compilation error and non zero exit status. 
Do I have to specify lib=? I never specified the library path before 
when I was using Fedora Core 6.


Warning in install.packages(RSQLite) : argument 'lib' is missing: 
using '/usr/lib/R/library'
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/RSQLite_0.5-6.tar.gz'
Content type 'application/x-gzip' length 710241 bytes
opened URL
==
downloaded 693Kb

gcc -std=gnu99 -shared -L/usr/local/lib -o RSQLite.so RS-DBI.o 
RS-SQLite.o sqlite-all.o   -L/usr/lib/R/lib -lR
/usr/bin/ld: skipping incompatible /usr/lib/R/lib/libR.so when 
searching for -lR
/usr/bin/ld: cannot find -lR
collect2: ld returned 1 exit status
make: *** [RSQLite.so] Error 1
chmod: cannot access `/usr/lib/R/library/RSQLite/libs/*': No such file 
or directory
ERROR: compilation failed for package 'RSQLite'
** Removing '/usr/lib/R/library/RSQLite'

The downloaded packages are in
/tmp/RtmpHQ5Y7C/downloaded_packages
Warning message:
installation of package 'RSQLite' had non-zero exit status in: 
install.packages(RSQLite)

I appreciate your help.

Thank you very much

Taka

__
R-help@stat.math.ethz.ch 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] Problem in installing packages on linux machine...

2007-09-08 Thread tkobayas
Hi,

Still got the same error message. I did su R when I got the error 
message for the first time. I have never seen this error message. I 
will be googling for solutions as well...

Thank you.

Quoting Henrique Dallazuanna [EMAIL PROTECTED]:

 Hi, try install packages whit 'sudo'.

 $sudo R

 --
 Henrique Dallazuanna
 Curitiba-Paraná-Brasil
 25° 25' 40 S 49° 16' 22 O

 On 08/09/2007, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hi,

 I am trying to install RSQLite package on my Fedora workstation. I
 tried to install other packages as well, but each time I got the same
 error messages saying compilation error and non zero exit status.
 Do I have to specify lib=? I never specified the library path before
 when I was using Fedora Core 6.


 Warning in install.packages(RSQLite) : argument 'lib' is missing:
 using '/usr/lib/R/library'
 --- Please select a CRAN mirror for use in this session ---
 Loading Tcl/Tk interface ... done
 trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/RSQLite_0.5-6.tar.gz'
 Content type 'application/x-gzip' length 710241 bytes
 opened URL
 ==
 downloaded 693Kb

 gcc -std=gnu99 -shared -L/usr/local/lib -o RSQLite.so RS-DBI.o
 RS-SQLite.o sqlite-all.o   -L/usr/lib/R/lib -lR
 /usr/bin/ld: skipping incompatible /usr/lib/R/lib/libR.so when
 searching for -lR
 /usr/bin/ld: cannot find -lR
 collect2: ld returned 1 exit status
 make: *** [RSQLite.so] Error 1
 chmod: cannot access `/usr/lib/R/library/RSQLite/libs/*': No such file
 or directory
 ERROR: compilation failed for package 'RSQLite'
 ** Removing '/usr/lib/R/library/RSQLite'

 The downloaded packages are in
 /tmp/RtmpHQ5Y7C/downloaded_packages
 Warning message:
 installation of package 'RSQLite' had non-zero exit status in:
 install.packages(RSQLite)

 I appreciate your help.

 Thank you very much

 Taka

 __
 R-help@stat.math.ethz.ch 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.






Takatsugu Kobayashi
PhD Student
Indiana University, Dept. Geography

__
R-help@stat.math.ethz.ch 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] problems in read.table

2007-09-06 Thread tkobayas
Dear R-users,

I have encountered the following problem every now and then. But I was 
dealing with a very small dataset before, so it wasn't a problem (I 
just edited the dataset in Openoffice speadsheet). This time I have to 
deal with many large datasets containing commuting flow data. I 
appreciate if anyone could give me a hint or clue to get out of this 
problem.

I have a .dat file called 1081.dat: 1001 means Birmingham, AL.

I imported this .dat file using read.table like
tmp-read.table('CTPP3_ANSI/MPO3441_ctpp3_sumlv944.dat',header=T)

Then I got this error message:
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
line 9499 did not have 209 elements

Since I got an error message saying other rows did not have 209 
elements, I added skip=c(205,9499,9294)) in hoping that R would take 
care of this problem. But I got a similar error message:
tmp-read.table('CTPP3_ANSI/MPO3441_ctpp3_sumlv944.dat',header=T,skip=c(205,9499,9294))
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
line 9294 did not have 209 elements
In addition: Warning message:
the condition has length  1 and only the first element will be used 
in: if (skip  0) readLines(file, skip)

Is there any way to let a R code to automatically skip problematic 
rows? Thank you very much!

Taka

__
R-help@stat.math.ethz.ch 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] problems in read.table-Solved

2007-09-06 Thread tkobayas
Thank you very much for help. I am learning R every day

Taka

Quoting Peter Dalgaard [EMAIL PROTECTED]:

 [EMAIL PROTECTED] wrote:
 Dear R-users,

 I have encountered the following problem every now and then. But I
 was dealing with a very small dataset before, so it wasn't a problem
 (I just edited the dataset in Openoffice speadsheet). This time I
 have to deal with many large datasets containing commuting flow
 data. I appreciate if anyone could give me a hint or clue to get out
 of this problem.

 I have a .dat file called 1081.dat: 1001 means Birmingham, AL.

 I imported this .dat file using read.table like
 tmp-read.table('CTPP3_ANSI/MPO3441_ctpp3_sumlv944.dat',header=T)

 Then I got this error message:
 Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
 na.strings,  :
 line 9499 did not have 209 elements

 Since I got an error message saying other rows did not have 209
 elements, I added skip=c(205,9499,9294)) in hoping that R would take
 care of this problem. But I got a similar error message:
 tmp-read.table('CTPP3_ANSI/MPO3441_ctpp3_sumlv944.dat',header=T,skip=c(205,9499,9294))
 Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
 na.strings,  :
 line 9294 did not have 209 elements
 In addition: Warning message:
 the condition has length  1 and only the first element will be used
 in: if (skip  0) readLines(file, skip)

 Is there any way to let a R code to automatically skip problematic
 rows? Thank you very much!


 Skip is the NUMBER of rows to skip before reading. It has to be a
 single number.

 You can use fill and flush to read lines with too few or too many
 elements, but it might be better to investigate the cause of the
 problem. What are in those lines? Quote and comment characters are
 common culprits.

 Taka

 __
 R-help@stat.math.ethz.ch 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.



 --
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
 ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907







Takatsugu Kobayashi
PhD Student
Indiana University, Dept. Geography

__
R-help@stat.math.ethz.ch 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] combining datasets by row

2007-08-29 Thread tkobayas
Rusers,

I am trying to append multiple .csv files of different dimensions (but 
# of columns are the same for all .csv files). I do have .csv files 
whose names are CA1.csv ~ CA100.csv. CA means california and 1 means 
the first file. So what I have been doing (after googling how to append 
by row multiple files) was:

cleanup_data-function(state,count)
{
   out-matrix()
   for (i in 1: count)
  {
  tmp-read.csv(paste(CTPP3/,state,i,.csv,sep=),header=F)
  out-rbind(out,tmp)
  }
   write.csv(file.out,file='file_output.csv')
}

I got an error message:

cleanup_data('CA',7)
Error in match.names(clabs, names(xi)) : names do not match previous names


Which name is this error message referring to?

I decided to get out of Excel and Access trap.

Thank you very much

Taka

__
R-help@stat.math.ethz.ch 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] rJava help

2007-04-19 Thread tkobayas
Hi,

I use Redhat Linux for R. Now I am trying to use the rJava library. I 
downloaded JRE beta 2 from Sun. I typed

[EMAIL PROTECTED] R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.6.0-beta2
Java home path   : /usr/java/jre1.6.0
Java library path: 
$(JAVA_HOME)/lib/amd64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64::/usr/java/packages/lib/amd64:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server 
-L$(JAVA_HOME)/lib/amd64 -L$(JAVA_HOME)/../lib/amd64 -L 
-L/usr/java/packages/lib/amd64 -L/lib -L/usr/lib -ljvm

when I try to install rJava, it says

configure: error: jni headers not found. Please make sure you have a 
proper JDK installed.
ERROR: configuration failed for package 'rJava'
** Removing '/usr/lib64/R/library/rJava'

The downloaded packages are in
/tmp/Rtmp7RF5Qs/downloaded_packages
Warning message:
installation of package 'rJava' had non-zero exit status in: 
install.packages(rJava)

How can I solve this?

Thanks for help in advance.

Taka

__
R-help@stat.math.ethz.ch 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] Help for looping

2007-03-26 Thread tkobayas
Rusers:

I have tried to minimize computing times by taking advanage of 
lapply(). My data is a 1000*30 matrix and the distance matrix was 
created with dist(). What I am trying to do is to compute the standard 
distances using the frequencies attached to the nearest negibors of n 
reference zones. So I will have 1000 standard distances, and would like 
to see the frequency distribution of the standard distances.

# Convert decimal degrees into UTM miles
x-(data[,1]-58277.194363)*0.000621
y-(data[,2]-4414486.03135)*0.000621

# Combine x y for computing distances
coords-cbind(x,y)
pts-length(data)

# Subset housing data and employment data
RES-data[,3:17]
EMP-data[,378:392]

# Combine all the subdata as D
D-cbind(coords,RES,EMP)

cases-ncol(D)-ncol(coords)

# Create a threshold bandwidth for defining the nearest neighbors
thrs-seq(0,35,by=1)

SDTAZ-rep(list(matrix(,nrow(D),length(thrs))),cases)


for (j in 1:nrow(D))
for (k in 1:length(thrs))
for (l in 1:cases)
{
{
{

SDTAZ[[l]][j,k]-
sqrt(
   sum(
(D[as.vector(which(dis[j,]=thrs[k])),l+2]-D[j,l+2]-
  min(D[as.vector(which(dis[j,]=thrs[k])),l+2]-D[j,l+2])+1)*
 (
   (dis[j,as.vector(which(dis[j,]=thrs[k]))])^2
 )
  )

/sum(D[as.vector(which(dis[j,]=thrs[k])),l+2]-D[j,l+2]-
 min(D[as.vector(which(dis[j,]=thrs[k])),l+2]-D[j,l+2])+1)
)
}
}
}

I think that within this nested loop, I should use lapply() but I ended 
up getting different values I appreciate if someone could kindly 
help me.

Thank you very much.

Takatsugu Kobayashi
PhD Candidate
Indiana University, Dept. Geography

__
R-help@stat.math.ethz.ch 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] exporting graphics

2006-03-20 Thread tkobayas
Hi,

This is a very fundamental question. I want to export graphical results 
so that I can place them in an openoffice document. I use Fedora 5. Can 
anyone help? Thanks in advance.


Takatsugu Kobayashi
PhD Student
Indiana University, Dept. Geography

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html